WordPress.org

Make WordPress Core

Ticket #23431: 23431.2.diff

File 23431.2.diff, 1.2 KB (added by kovshenin, 6 years ago)
  • src/wp-includes/class-wp-embed.php

     
    1919                // Hack to get the [embed] shortcode to run before wpautop()
    2020                add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
    2121
    22                 // Shortcode placeholder for strip_shortcodes()
    23                 add_shortcode( 'embed', '__return_false' );
     22                // Shortcode callback.
     23                add_shortcode( 'embed', array( $this, 'shortcode' ) );
    2424
    2525                // Attempts to embed all URLs in a post
    2626                add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
  • tests/phpunit/tests/shortcode.php

     
    373373                remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
    374374        }
    375375
     376        /**
     377         * @ticket 23431
     378         */
     379        function test_embed_shortcode() {
     380                $content = '[embed]http://example.org/path/to/video.mp4[/embed]';
     381                $this->assertNotEmpty( do_shortcode( $content ) );
     382        }
    376383}