Skip to content

Commit

Permalink
Delete AMP_YouTube_Embed_Handler::shortcode() and oembed()
Browse files Browse the repository at this point in the history
As Weston mentioned,
these aren't being used and can be deleted.
  • Loading branch information
kienstra committed Dec 5, 2019
1 parent 6ae3419 commit 4726922
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions includes/embeds/class-amp-youtube-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,51 +124,6 @@ private function parse_props( $html, $url, $video_id ) {
return $props;
}

/**
* Gets AMP-compliant markup for the YouTube shortcode.
*
* @deprecated 1.5.0 This was moved to Jetpack, in jetpack_amp_youtube_shortcode().
*
* @param array $attr The YouTube attributes.
* @return string YouTube shortcode markup.
*/
public function shortcode( $attr ) {
_deprecated_function( __METHOD__, '1.5.0' );
$url = false;

if ( isset( $attr[0] ) ) {
$url = ltrim( $attr[0], '=' );
} elseif ( function_exists( 'shortcode_new_to_old_params' ) ) {
$url = shortcode_new_to_old_params( $attr );
}

if ( empty( $url ) ) {
return '';
}

$video_id = $this->get_video_id_from_url( $url );

return $this->render( compact( 'video_id' ), $url );
}

/**
* Render oEmbed.
*
* @see \WP_Embed::shortcode()
* @deprecated This is no longer being used.
*
* @param array $matches URL pattern matches.
* @param array $attr Shortcode attribues.
* @param string $url URL.
* @return string Rendered oEmbed.
*/
public function oembed( $matches, $attr, $url ) {
unset( $matches, $attr );
_deprecated_function( __METHOD__, '1.5.0' );

return $this->shortcode( [ $url ] );
}

/**
* Render embed.
*
Expand Down

0 comments on commit 4726922

Please sign in to comment.