Filter hook 'wp_get_missing_image_subsizes'

in WP Core File wp-admin/includes/image.php at line 146

View Source

wp_get_missing_image_subsizes

Filter Hook
Description
Filters the array of missing image sub-sizes for an uploaded image.

Hook Information

File Location wp-admin/includes/image.php View on GitHub
Hook Type Filter
Line Number 146

Hook Parameters

Type Name Description
array[] $missing_sizes Associative array of arrays of image sub-size information for missing image sizes, keyed by image size name.
array $image_meta The image meta data.
int $attachment_id The image attachment post ID.

Usage Examples

Basic Usage
<?php
// Hook into wp_get_missing_image_subsizes
add_filter('wp_get_missing_image_subsizes', 'my_custom_filter', 10, 3);

function my_custom_filter($missing_sizes, $image_meta, $attachment_id) {
    // Your custom filtering logic here
    return $missing_sizes;
}

Source Code Context

wp-admin/includes/image.php:146 - How this hook is used in WordPress core
<?php
 141  	 * @param array[] $missing_sizes Associative array of arrays of image sub-size information for
 142  	 *                               missing image sizes, keyed by image size name.
 143  	 * @param array   $image_meta    The image meta data.
 144  	 * @param int     $attachment_id The image attachment post ID.
 145  	 */
 146  	return apply_filters( 'wp_get_missing_image_subsizes', $missing_sizes, $image_meta, $attachment_id );
 147  }
 148  
 149  /**
 150   * If any of the currently registered image sub-sizes are missing,
 151   * create them and update the image meta data.

PHP Documentation

<?php
/**
	 * Filters the array of missing image sub-sizes for an uploaded image.
	 *
	 * @since 5.3.0
	 *
	 * @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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-admin/includes/image.php
Related Hooks

Related hooks will be displayed here in future updates.