embed_thumbnail_image_shape

Filters the thumbnail shape for use in the embed template.

Description

apply_filters( 'embed_thumbnail_image_shape', (string) $shape, (int) $thumbnail_id ); 

Rectangular images are shown above the title while square images are shown next to the content.

Parameters (2)

0. $shape (string)
Thumbnail image shape. Either rectangular or square..
1. $thumbnail_id (int)
The thumbnail id.

Usage

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

Defined (1)

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

/wp-includes/theme-compat/embed-content.php  
  1. $shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );