Skip to content

Commit

Permalink
Remove call to removed method; update phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Dec 4, 2019
1 parent 672997e commit e168813
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 29 deletions.
2 changes: 1 addition & 1 deletion includes/embeds/class-amp-dailymotion-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function unregister_embed() {
* @see \WP_Embed::shortcode()
*
* @param array $matches URL pattern matches.
* @param array $attr Shortcode attribues.
* @param array $attr Shortcode attributes.
* @param string $url URL.
* @param string $rawattr Unmodified shortcode attributes.
* @return string Rendered oEmbed.
Expand Down
4 changes: 2 additions & 2 deletions includes/embeds/class-amp-gfycat-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function unregister_embed() {
/**
* Filter oEmbed HTML for Gfycat to prepare it for AMP.
*
* @param mixed $return The shortcode callback function to call.
* @param mixed $return The oEmbed HTML.
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
* @param array $attr Attributes.
* @return string Embed.
*/
public function filter_embed_oembed_html( $return, $url, $attr ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/embeds/class-amp-hulu-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public function unregister_embed() {
/**
* Filter oEmbed HTML for Hulu to prepare it for AMP.
*
* @param mixed $return The shortcode callback function to call.
* @param mixed $return The oEmbed HTML.
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
* @param array $attr Attributes.
* @return string Embed.
*/
public function filter_embed_oembed_html( $return, $url, $attr ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/embeds/class-amp-imgur-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ public function render( $args ) {
/**
* Filter oEmbed HTML for Imgur to prepare it for AMP.
*
* @param mixed $return The shortcode callback function to call.
* @param mixed $return The oEmbed HTML.
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
* @param array $attr Attributes.
* @return string Embed.
*/
public function filter_embed_oembed_html( $return, $url, $attr ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/embeds/class-amp-issuu-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function unregister_embed() {
/**
* Filter oEmbed HTML for Meetup to prepare it for AMP.
*
* @param mixed $return The shortcode callback function to call.
* @param mixed $return The oEmbed HTML.
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
* @param array $attr Attributes.
* @return string Embed.
*/
public function filter_embed_oembed_html( $return, $url, $attr ) {
Expand Down
18 changes: 3 additions & 15 deletions includes/embeds/class-amp-twitter-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,13 @@ public function filter_embed_oembed_html( $cache, $url ) {
/**
* Render oEmbed.
*
* @deprecated Since 1.1 as now the sanitize_raw_embeds() is used exclusively, allowing the original oEmbed response to be rapped by amp-twitter.
* @see \WP_Embed::shortcode()
* @deprecated Shortcode support has been moved to Jetpack.
*
* @param array $matches URL pattern matches.
* @return string Rendered oEmbed.
*/
public function oembed( $matches ) {
public function oembed() {
_deprecated_function( __METHOD__, '1.1' );
$id = false;

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

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

return $this->shortcode( [ 'tweet' => $id ] );
return '';
}

/**
Expand Down
7 changes: 2 additions & 5 deletions includes/embeds/class-amp-youtube-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,11 @@ private function parse_props( $html, $url, $video_id ) {
* @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 ) {
public function oembed() {
_deprecated_function( __METHOD__, '1.5.0' );
return $this->shortcode( [ $url ] );
return '';
}

/**
Expand Down

0 comments on commit e168813

Please sign in to comment.