Make WordPress Core


Ignore:
Timestamp:
05/06/2024 08:21:29 PM (9 months ago)
Author:
joemcgill
Message:

Docs: Update docblock for wp_get_attachment_image() attributes.

This updates the docblock attributes for wp_get_attachment_image() to account for attribute values that are being determined by wp_get_loading_optimization_attributes(). Updates docs for $attr['loading'] and adds docs for $attr['fetchpriority'].

Props joemcgill, dmsnell.
Fixes #59550.

File:
1 edited

Legend:

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

    r58097 r58110  
    10401040 *     Optional. Attributes for the image markup.
    10411041 *
    1042  *     @type string       $src      Image attachment URL.
    1043  *     @type string       $class    CSS class name or space-separated list of classes.
    1044  *                                  Default `attachment-$size_class size-$size_class`,
    1045  *                                  where `$size_class` is the image size being requested.
    1046  *     @type string       $alt      Image description for the alt attribute.
    1047  *     @type string       $srcset   The 'srcset' attribute value.
    1048  *     @type string       $sizes    The 'sizes' attribute value.
    1049  *     @type string|false $loading  The 'loading' attribute value. Passing a value of false
    1050  *                                  will result in the attribute being omitted for the image.
    1051  *                                  Defaults to 'lazy', depending on wp_lazy_loading_enabled().
    1052  *     @type string       $decoding The 'decoding' attribute value. Possible values are
    1053  *                                  'async' (default), 'sync', or 'auto'. Passing false or an empty
    1054  *                                  string will result in the attribute being omitted.
     1042 *     @type string       $src           Image attachment URL.
     1043 *     @type string       $class         CSS class name or space-separated list of classes.
     1044 *                                       Default `attachment-$size_class size-$size_class`,
     1045 *                                       where `$size_class` is the image size being requested.
     1046 *     @type string       $alt           Image description for the alt attribute.
     1047 *     @type string       $srcset        The 'srcset' attribute value.
     1048 *     @type string       $sizes         The 'sizes' attribute value.
     1049 *     @type string|false $loading       The 'loading' attribute value. Passing a value of false
     1050 *                                       will result in the attribute being omitted for the image.
     1051 *                                       Default determined by {@see wp_get_loading_optimization_attributes()}.
     1052 *     @type string       $decoding      The 'decoding' attribute value. Possible values are
     1053 *                                       'async' (default), 'sync', or 'auto'. Passing false or an empty
     1054 *                                       string will result in the attribute being omitted.
     1055 *     @type string       $fetchpriority The 'fetchpriority' attribute value, whether `high`, `low`, or `auto`.
     1056 *                                       Default determined by {@see wp_get_loading_optimization_attributes()}.
    10551057 * }
    10561058 * @return string HTML img element or empty string on failure.
Note: See TracChangeset for help on using the changeset viewer.