embed_thumbnail_image_shape
Filters the thumbnail shape for use in the embed template.
Rectangular images are shown above the title while square images are shown next to the content.
Usage
add_filter( 'embed_thumbnail_image_shape', 'wp_kama_embed_thumbnail_image_shape_filter', 10, 2 ); /** * Function for `embed_thumbnail_image_shape` filter-hook. * * @param string $shape Thumbnail image shape. Either 'rectangular' or 'square'. * @param int $thumbnail_id Attachment ID. * * @return string */ function wp_kama_embed_thumbnail_image_shape_filter( $shape, $thumbnail_id ){ // filter... return $shape; }
- $shape(string)
- Thumbnail image shape. Either 'rectangular' or 'square'.
- $thumbnail_id(int)
- Attachment ID.
Changelog
Since 4.4.0 | Introduced. |
Since 4.5.0 | Added $thumbnail_id parameter. |
Where the hook is called
embed_thumbnail_image_shape
wp-includes/theme-compat/embed-content.php 75
$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );