Media: Fix inconsistent docs for existing `wp_img_tag_add_loading_attr` filter and remove duplicate.

Follow-up to [56037].

Props thekt12.
See #58235.

Built from https://develop.svn.wordpress.org/trunk@56112


git-svn-id: http://core.svn.wordpress.org/trunk@55624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2023-06-29 17:34:23 +00:00
parent 86d28672fe
commit a1fcd5eaa4
3 changed files with 4 additions and 17 deletions

View File

@ -4779,19 +4779,7 @@ function wp_img_tag_add_loading_attr( $image, $context ) {
return $image;
}
/**
* Filters the `loading` attribute value to add to an image. Default `lazy`.
*
* Returning `false` or an empty string will not add the attribute.
* Returning `true` will add the default value.
*
* @since 5.5.0
*
* @param string|bool $value The `loading` attribute value. Returning a falsey value will result in
* the attribute being omitted for the image.
* @param string $image The HTML `img` tag to be filtered.
* @param string $context Additional context about how the function was called or where the img tag is.
*/
/** This filter is documented in wp-admin/includes/media.php */
$value = apply_filters( 'wp_img_tag_add_loading_attr', $value, $image, $context );
if ( $value ) {

View File

@ -1963,15 +1963,14 @@ function wp_img_tag_add_loading_optimization_attrs( $image, $context ) {
if ( empty( $loading_val ) && $loading_attrs_enabled ) {
/**
* Filters the `loading` attribute value to add to an image. Default `lazy`.
* This filter is added in for backward compatibility.
*
* Returning `false` or an empty string will not add the attribute.
* Returning `true` will add the default value.
* `true` and `false` usage supported for backward compatibility.
*
* @since 5.5.0
*
* @param string|bool $loading Current value for `loading` attribute for the image.
* @param string|bool $value The `loading` attribute value. Returning a falsey value will result in
* the attribute being omitted for the image.
* @param string $image The HTML `img` tag to be filtered.
* @param string $context Additional context about how the function was called or where the img tag is.
*/

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-beta2-56111';
$wp_version = '6.3-beta2-56112';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.