Skip to content

Commit 60b3fe7

Browse files
committed
Media: Fix inconsistent docs for existing wp_img_tag_add_loading_attr filter and remove duplicate.
Follow-up to [56037]. Props thekt12. See #58235. git-svn-id: https://develop.svn.wordpress.org/trunk@56112 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c650864 commit 60b3fe7

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

src/wp-includes/deprecated.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4779,19 +4779,7 @@ function wp_img_tag_add_loading_attr( $image, $context ) {
47794779
return $image;
47804780
}
47814781

4782-
/**
4783-
* Filters the `loading` attribute value to add to an image. Default `lazy`.
4784-
*
4785-
* Returning `false` or an empty string will not add the attribute.
4786-
* Returning `true` will add the default value.
4787-
*
4788-
* @since 5.5.0
4789-
*
4790-
* @param string|bool $value The `loading` attribute value. Returning a falsey value will result in
4791-
* the attribute being omitted for the image.
4792-
* @param string $image The HTML `img` tag to be filtered.
4793-
* @param string $context Additional context about how the function was called or where the img tag is.
4794-
*/
4782+
/** This filter is documented in wp-admin/includes/media.php */
47954783
$value = apply_filters( 'wp_img_tag_add_loading_attr', $value, $image, $context );
47964784

47974785
if ( $value ) {

src/wp-includes/media.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,15 +1963,14 @@ function wp_img_tag_add_loading_optimization_attrs( $image, $context ) {
19631963
if ( empty( $loading_val ) && $loading_attrs_enabled ) {
19641964
/**
19651965
* Filters the `loading` attribute value to add to an image. Default `lazy`.
1966-
* This filter is added in for backward compatibility.
19671966
*
19681967
* Returning `false` or an empty string will not add the attribute.
19691968
* Returning `true` will add the default value.
1970-
* `true` and `false` usage supported for backward compatibility.
19711969
*
19721970
* @since 5.5.0
19731971
*
1974-
* @param string|bool $loading Current value for `loading` attribute for the image.
1972+
* @param string|bool $value The `loading` attribute value. Returning a falsey value will result in
1973+
* the attribute being omitted for the image.
19751974
* @param string $image The HTML `img` tag to be filtered.
19761975
* @param string $context Additional context about how the function was called or where the img tag is.
19771976
*/

0 commit comments

Comments
 (0)