short_title = __( 'YouTube Playlist', 'broken-link-checker' ); $this->long_title = __( 'Embedded YouTube playlist', 'broken-link-checker' ); $this->url_search_string = 'youtube.com/p/'; } function link_url_from_src( $src ) { //Extract playlist ID from the SRC. $path = parse_url( $src, PHP_URL_PATH ); if ( empty( $path ) ) { return null; } if ( preg_match( '@/p/(?P[^/?&#]+?)(?:[?&#]|$)@', trim( $path ), $matches ) ) { $playlist_id = $matches['id']; } else { return null; } //Reconstruct the playlist permalink based on the ID $url = 'http://www.youtube.com/playlist?list=' . $playlist_id; return $url; } }