embed_thumbnail_image_shape filter-hookWP 4.4.0

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.


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;
Thumbnail image shape. Either 'rectangular' or 'square'.
Attachment ID.


Since 4.4.0 Introduced.
Since 4.5.0 Added $thumbnail_id parameter.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.