Docs: Correct duplicate hook reference for wp_min_priority_img_pixels.

The original filter location is `wp_maybe_add_fetchpriority_high_attr()` in `wp-includes/media.php`.

This commit updates the instance in `wp_get_loading_optimization_attributes()` to point to the correct file.

Follow-up to [56037], [56143], [56347].

Props tmatsuur, rajinsharwar, khokansardar.
Fixes #59067.
Built from https://develop.svn.wordpress.org/trunk@56386


git-svn-id: http://core.svn.wordpress.org/trunk@55898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-08-11 11:35:19 +00:00
parent 96c6c273dd
commit 93bf4a6d6f
2 changed files with 6 additions and 2 deletions

View File

@ -5772,7 +5772,7 @@ function wp_get_loading_optimization_attributes( $tag_name, $attr, $context ) {
if ( $increase_count ) {
wp_increase_content_media_count();
} elseif ( $maybe_increase_count ) {
/** This filter is documented in wp-admin/includes/media.php */
/** This filter is documented in wp-includes/media.php */
$wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 );
if ( $wp_min_priority_img_pixels <= $attr['width'] * $attr['height'] ) {
@ -5862,6 +5862,7 @@ function wp_maybe_add_fetchpriority_high_attr( $loading_attrs, $tag_name, $attr
$loading_attrs['fetchpriority'] = 'high';
wp_high_priority_element_flag( false );
}
return $loading_attrs;
}
@ -5882,10 +5883,12 @@ function wp_maybe_add_fetchpriority_high_attr( $loading_attrs, $tag_name, $attr
* @param int $threshold Minimum square-pixels threshold. Default 50000.
*/
$wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 );
if ( $wp_min_priority_img_pixels <= $attr['width'] * $attr['height'] ) {
$loading_attrs['fetchpriority'] = 'high';
wp_high_priority_element_flag( false );
}
return $loading_attrs;
}
@ -5904,5 +5907,6 @@ function wp_high_priority_element_flag( $value = null ) {
if ( is_bool( $value ) ) {
$high_priority_element = $value;
}
return $high_priority_element;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56385';
$wp_version = '6.4-alpha-56386';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.