diff --git a/src/wp-includes/class-wp-embed.php b/src/wp-includes/class-wp-embed.php
index 16e5acd79f..7405197094 100644
--- a/src/wp-includes/class-wp-embed.php
+++ b/src/wp-includes/class-wp-embed.php
@@ -129,12 +129,6 @@ class WP_Embed {
* `->maybe_make_link()` can return false on failure.
*/
public function shortcode( $attr, $url = '' ) {
- // This filter can be used to output custom HTML instead of allowing oEmbed to run.
- $custom = apply_filters( 'wp_embed_shortcode_custom', false, $attr, $url );
- if ( false !== $custom ) {
- return $custom;
- }
-
$post = get_post();
if ( empty( $url ) && ! empty( $attr['src'] ) ) {
diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php
index 46f9cc61c1..eab27168ad 100644
--- a/tests/phpunit/tests/media.php
+++ b/tests/phpunit/tests/media.php
@@ -655,11 +655,11 @@ EOF;
/**
* @ticket 33016
*/
- function filter_wp_embed_shortcode_custom( $custom, $attr, $url ) {
+ function filter_wp_embed_shortcode_custom( $content, $url ) {
if ( 'https://www.example.com/?video=1' == $url ) {
- $custom = "";
+ $content = '@embed URL was replaced@';
}
- return $custom;
+ return $content;
}
/**
@@ -667,14 +667,14 @@ EOF;
*/
function test_oembed_explicit_media_link() {
global $wp_embed;
- add_filter( 'wp_embed_shortcode_custom', array( $this, 'filter_wp_embed_shortcode_custom' ), 10, 3 );
+ add_filter( 'embed_maybe_make_link', array( $this, 'filter_wp_embed_shortcode_custom' ), 10, 2 );
$content = <<
+@embed URL was replaced@
EOF;
$result = $wp_embed->autoembed( $content );
@@ -686,7 +686,7 @@ EOF;
_my_function('data');
myvar = 'Hello world
https://www.example.com/?video=1
-don't break this';
+do not break this';
// ]]>
EOF;
@@ -694,6 +694,6 @@ EOF;
$result = $wp_embed->autoembed( $content );
$this->assertEquals( $content, $result );
- remove_filter( 'wp_embed_shortcode_custom', array( $this, 'filter_wp_embed_shortcode_custom' ), 10 );
+ remove_filter( 'embed_maybe_make_link', array( $this, 'filter_wp_embed_shortcode_custom' ), 10 );
}
}