embed_thumbnail_image_size
Filter HookDescription
Filters the thumbnail image size for use in the embed template.Hook Information
File Location |
wp-includes/theme-compat/embed-content.php
View on GitHub
|
Hook Type | Filter |
Line Number | 59 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$image_size
|
Thumbnail image size. |
int
|
$thumbnail_id
|
Attachment ID. |
Usage Examples
Basic Usage
<?php
// Hook into embed_thumbnail_image_size
add_filter('embed_thumbnail_image_size', 'my_custom_filter', 10, 2);
function my_custom_filter($image_size, $thumbnail_id) {
// Your custom filtering logic here
return $image_size;
}
Source Code Context
wp-includes/theme-compat/embed-content.php:59
- How this hook is used in WordPress core
<?php
54 * @since 4.5.0 Added `$thumbnail_id` parameter.
55 *
56 * @param string $image_size Thumbnail image size.
57 * @param int $thumbnail_id Attachment ID.
58 */
59 $image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id );
60
61 $shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';
62
63 /**
64 * Filters the thumbnail shape for use in the embed template.
PHP Documentation
<?php
/**
* Filters the thumbnail image size for use in the embed template.
*
* @since 4.4.0
* @since 4.5.0 Added `$thumbnail_id` parameter.
*
* @param string $image_size Thumbnail image size.
* @param int $thumbnail_id Attachment ID.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/theme-compat/embed-content.php
Related Hooks
Related hooks will be displayed here in future updates.