WP_Embed::run_shortcode() – Process the [embed] shortcode.

You appear to be a bot. Output may be restricted

Description

Processes the [embed] shortcode.

Since the [embed] shortcode needs to be run earlier than other shortcodes, this function removes all existing shortcodes, registers the [embed] shortcode, calls do_shortcode(), and then re-registers the old shortcodes.

Usage

$string = WP_Embed::run_shortcode( $content );

Parameters

$content
( string ) required – Content to parse.

Returns

string Content with shortcode parsed.

Source

File name: wordpress/wp-includes/class-wp-embed.php
Lines:

1 to 17 of 17
  public function run_shortcode( $content ) {
    global $shortcode_tags;

    // Back up current registered shortcodes and clear them all out.
    $orig_shortcode_tags = $shortcode_tags;
    remove_all_shortcodes();

    add_shortcode( 'embed', array( $this, 'shortcode' ) );

    // Do the shortcode (only the [embed] one is registered).
    $content = do_shortcode( $content, true );

    // Put the original shortcodes back.
    $shortcode_tags = $orig_shortcode_tags;

    return $content;
  }
 

 View on GitHub View on Trac