embed

The WordPress Core embed shortcode.


Usage

  1. // basic usage 
  2. echo do_shortcode('[embed]'); 
  1. // variable usage 
  2. $result = do_shortcode('[embed]'); 
  3. echo $result;  

Defined (2)

The shortcode is defined in the following location(s).

/wp-includes/class-wp-embed.php  
  1. public function __construct() { 
  2. // Hack to get the [embed] shortcode to run before wpautop() 
  3. add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 ); 
  4.  
  5. // Shortcode placeholder for strip_shortcodes() 
  6. add_shortcode( 'embed', '__return_false' ); 
  7.  
  8. // Attempts to embed all URLs in a post 
  9. add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); 
  10.  
  11. // After a post is saved, cache oEmbed items via Ajax 
  1.  
  2. // Back up current registered shortcodes and clear them all out 
  3. $orig_shortcode_tags = $shortcode_tags; 
  4.  
  5. add_shortcode( 'embed', array( $this, 'shortcode' ) ); 
  6.  
  7. // Do the shortcode (only the [embed] one is registered) 
  8. $content = do_shortcode( $content, true ); 
  9.  
  10. // Put the original shortcodes back