embed_thumbnail_id
Filter HookDescription
Filters the thumbnail image ID 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 | 32 |
Hook Parameters
Type | Name | Description |
---|---|---|
int|false
|
$thumbnail_id
|
Attachment ID, or false if there is none. |
Usage Examples
Basic Usage
<?php
// Hook into embed_thumbnail_id
add_filter('embed_thumbnail_id', 'my_custom_filter', 10, 1);
function my_custom_filter($thumbnail_id) {
// Your custom filtering logic here
return $thumbnail_id;
}
Source Code Context
wp-includes/theme-compat/embed-content.php:32
- How this hook is used in WordPress core
<?php
27 *
28 * @since 4.9.0
29 *
30 * @param int|false $thumbnail_id Attachment ID, or false if there is none.
31 */
32 $thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );
33
34 if ( $thumbnail_id ) {
35 $aspect_ratio = 1;
36 $measurements = array( 1, 1 );
37 $image_size = 'full'; // Fallback.
PHP Documentation
<?php
/**
* Filters the thumbnail image ID for use in the embed template.
*
* @since 4.9.0
*
* @param int|false $thumbnail_id Attachment ID, or false if there is none.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/theme-compat/embed-content.php
Related Hooks
Related hooks will be displayed here in future updates.