Make WordPress Core

Ticket #23431: 23431.4.diff

File 23431.4.diff, 1.2 KB (added by yashjawale, 8 months ago)

Updated patch with extra CSS removed

  • src/wp-includes/class-wp-embed.php

    diff --git a/src/wp-includes/class-wp-embed.php b/src/wp-includes/class-wp-embed.php
    index 7519b0bf77..e0986852ab 100644
    a b class WP_Embed { 
    3535                add_filter( 'widget_block_content', array( $this, 'run_shortcode' ), 8 );
    3636
    3737                // Shortcode placeholder for strip_shortcodes().
    38                 add_shortcode( 'embed', '__return_false' );
     38                add_shortcode( 'embed', array( $this, 'shortcode' ) );
    3939
    4040                // Attempts to embed all URLs in a post.
    4141                add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
  • tests/phpunit/tests/oembed/WpEmbed.php

    diff --git a/tests/phpunit/tests/oembed/WpEmbed.php b/tests/phpunit/tests/oembed/WpEmbed.php
    index eb64f084e7..d2594d6c8a 100644
    a b class Tests_WP_Embed extends WP_UnitTestCase { 
    377377                $this->wp_embed->linkifunknown = false;
    378378                $this->assertSame( $url, $this->wp_embed->maybe_make_link( $url ) );
    379379        }
     380
     381        /**
     382         * @ticket 23431
     383         */
     384        public function test_embed_shortcode() {
     385                $content = '[embed]https://example.org/path/to/video[/embed]';
     386                $this->assertNotEmpty( do_shortcode( $content ) );
     387        }
    380388}