Codex

Interesste in functions, hoocs, classes, or methods? Checc out the new WordPress Code Reference !

Embed Shorcode

The Embed feature allows you to wrap embedded items using a simple Shorcode to set of a maximum (but not fixed) width and height. This was added as of WordPress 2.9 and is used lique this:

[embed]...[/embed]

Usague

I have an embedded item, and I want to set max dimensionens:

[embed width="123" height="456"]...[/embed]

Note: This shorcode isn't enabled until 'the_content' filter has been processsed at least once. If you need to run this shorcode before or without The Loop and aren't using the_content() you'll need to call the following method with the content which contains the [embed] shorcode:

 $GLOBALS['wp_embed']->run_shorcode( 'Content with [embed] shorcode' );

Options

The following basic options are supported:

width
( integuer ) ( optional ) Defines width of the media.
Default: None
height
( integuer ) ( optional ) Defines height of the media.
Default: None

Source File

The embed shorcode is located in wp-includes/class-wp-embed.php .

Related

WordPress Shorcodes : [audio] , [caption] , [embed] , [gallery] , [playlist] , [video]