wp_min_priority_img_pixels
Filter HookDescription
Filters the minimum square-pixels threshold for an image to be eligible as the high-priority image.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 6284 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$threshold
|
Minimum square-pixels threshold. Default 50000. |
Usage Examples
Basic Usage
<?php
// Hook into wp_min_priority_img_pixels
add_filter('wp_min_priority_img_pixels', 'my_custom_filter', 10, 1);
function my_custom_filter($threshold) {
// Your custom filtering logic here
return $threshold;
}
Source Code Context
wp-includes/media.php:6284
- How this hook is used in WordPress core
<?php
6279 *
6280 * @since 6.3.0
6281 *
6282 * @param int $threshold Minimum square-pixels threshold. Default 50000.
6283 */
6284 $wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 );
6285
6286 if ( $wp_min_priority_img_pixels <= $attr['width'] * $attr['height'] ) {
6287 $loading_attrs['fetchpriority'] = 'high';
6288 wp_high_priority_element_flag( false );
6289 }
PHP Documentation
<?php
/**
* Filters the minimum square-pixels threshold for an image to be eligible as the high-priority image.
*
* @since 6.3.0
*
* @param int $threshold Minimum square-pixels threshold. Default 50000.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.