wp_get_missing_image_subsizes
Filters the array of missing image sub-sizes for an uploaded image.
Usage
add_filter( 'wp_get_missing_image_subsizes', 'wp_kama_get_missing_image_subsizes_filter', 10, 3 ); /** * Function for `wp_get_missing_image_subsizes` filter-hook. * * @param array[] $missing_sizes Associative array of arrays of image sub-size information for missing image sizes, keyed by image size name. * @param array $image_meta The image meta data. * @param int $attachment_id The image attachment post ID. * * @return array[] */ function wp_kama_get_missing_image_subsizes_filter( $missing_sizes, $image_meta, $attachment_id ){ // filter... return $missing_sizes; }
- $missing_sizes(array[])
- Associative array of arrays of image sub-size information for missing image sizes, keyed by image size name.
- $image_meta(array)
- The image meta data.
- $attachment_id(int)
- The image attachment post ID.
Changelog
Since 5.3.0 | Introduced. |
Where the hook is called
wp_get_missing_image_subsizes
wp-admin/includes/image.php 146
return apply_filters( 'wp_get_missing_image_subsizes', $missing_sizes, $image_meta, $attachment_id );