fallback_intermediate_image_sizes
Filter HookDescription
Filters the image sizes generated for non-image mime types.Hook Information
File Location |
wp-admin/includes/image.php
View on GitHub
|
Hook Type | Filter |
Line Number | 686 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$fallback_sizes
|
An array of image size names. |
array
|
$metadata
|
Current attachment metadata. |
Usage Examples
Basic Usage
<?php
// Hook into fallback_intermediate_image_sizes
add_filter('fallback_intermediate_image_sizes', 'my_custom_filter', 10, 2);
function my_custom_filter($fallback_sizes, $metadata) {
// Your custom filtering logic here
return $fallback_sizes;
}
Source Code Context
wp-admin/includes/image.php:686
- How this hook is used in WordPress core
<?php
681 * @since 4.7.0
682 *
683 * @param string[] $fallback_sizes An array of image size names.
684 * @param array $metadata Current attachment metadata.
685 */
686 $fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );
687
688 $registered_sizes = wp_get_registered_image_subsizes();
689 $merged_sizes = array_intersect_key( $registered_sizes, array_flip( $fallback_sizes ) );
690
691 // Force thumbnails to be soft crops.
PHP Documentation
<?php
/**
* Filters the image sizes generated for non-image mime types.
*
* @since 4.7.0
*
* @param string[] $fallback_sizes An array of image size names.
* @param array $metadata Current attachment metadata.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/image.php
Related Hooks
Related hooks will be displayed here in future updates.