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.
Использование
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(строка)
- Thumbnail image shape. Either 'rectangular' or 'square'.
- $thumbnail_id(int)
- Attachment ID.
Список изменений
| С версии 4.4.0 | Введена. |
| С версии 4.5.0 | Added $thumbnail_id parameter. |
Где вызывается хук
embed_thumbnail_image_shape
wp-includes/theme-compat/embed-content.php 75
$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );