embed_html

Filters the embed HTML output for a given post.

Description

apply_filters( 'embed_html', (string) $output, (WP_Post) $post, (int) $width, (int) $height ); 

Parameters (4)

0. $output (string)
The default HTML.
1. $post (WP_Post)
Current post object.
2. $width (int)
Width of the response.
3. $height (int)
Height of the response.

Usage

To run the hook, copy the example below.
  1. $output = apply_filters( 'embed_html', $output, $post, $width, $height ); 
  2.  
  3. if ( !empty( $output ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the embed_html callback 
  2. function filter_embed_html( $output, $post, $width, $height ) { 
  3. // make filter magic happen here... 
  4. return $output
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'embed_html', 'filter_embed_html', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'embed_html', 'filter_embed_html', 10, 4 ); 

Defined (1)

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

/wp-includes/embed.php  
  1. return apply_filters( 'embed_html', $output, $post, $width, $height );