Skip to content

Commit

Permalink
Delete AMP_Twitter_Embed_Handler::oembed()
Browse files Browse the repository at this point in the history
As Weston mentioned, this has been deprecated
since v1.1.
  • Loading branch information
kienstra committed Dec 5, 2019
1 parent ba51034 commit 6ae3419
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions includes/embeds/class-amp-twitter-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,41 +56,6 @@ public function unregister_embed() {
wp_embed_unregister_handler( 'amp-twitter-timeline', -1 );
}

/**
* Render oEmbed.
*
* @deprecated Since 1.1 as now the sanitize_raw_embeds() is used exclusively, allowing the
* original oEmbed response to be wrapped with `amp-twitter`.
*
* @see \WP_Embed::shortcode()
*
* @param array $matches URL pattern matches.
* @return string Rendered oEmbed.
*/
public function oembed( $matches ) {
_deprecated_function( __METHOD__, '1.1' );
$id = false;

if ( isset( $matches['tweet'] ) && is_numeric( $matches['tweet'] ) ) {
$id = $matches['tweet'];
}

if ( ! $id ) {
return '';
}

$this->did_convert_elements = true;
return AMP_HTML_Utils::build_tag(
$this->amp_tag,
[
'data-tweetid' => $id,
'layout' => 'responsive',
'width' => $this->args['width'],
'height' => $this->args['height'],
]
);
}

/**
* Render oEmbed for a timeline.
*
Expand Down

0 comments on commit 6ae3419

Please sign in to comment.