embed_thumbnail_image_size

Filters the thumbnail image size for use in the embed template.

Description

apply_filters( 'embed_thumbnail_image_size', (string) $image_size, (int) $thumbnail_id ); 

Parameters (2)

0. $image_size (string)
Thumbnail image size.
1. $thumbnail_id (int)
The thumbnail id.

Usage

To run the hook, copy the example below.
  1. $image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id ); 
  2.  
  3. if ( !empty( $image_size ) ) { 
  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_size callback 
  2. function filter_embed_thumbnail_image_size( $image_size, $thumbnail_id ) { 
  3. // make filter magic happen here... 
  4. return $image_size
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'embed_thumbnail_image_size', 'filter_embed_thumbnail_image_size', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'embed_thumbnail_image_size', 'filter_embed_thumbnail_image_size', 10, 2 ); 

Defined (1)

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

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