Make WordPress Core

Changeset 56112


Ignore:
Timestamp:
06/29/2023 05:32:35 PM (8 months ago)
Author:
flixos90
Message:

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

Follow-up to [56037].

Props thekt12.
See #58235.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r56110 r56112  
    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
  • trunk/src/wp-includes/media.php

    r56037 r56112  
    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.
Note: See TracChangeset for help on using the changeset viewer.