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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill 2024-05-06 20:23:14 +00:00
parent e04a32b62f
commit 4f98bf32cf
2 changed files with 16 additions and 14 deletions

View File

@ -1039,19 +1039,21 @@ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon
* @param string|array $attr { * @param string|array $attr {
* Optional. Attributes for the image markup. * Optional. Attributes for the image markup.
* *
* @type string $src Image attachment URL. * @type string $src Image attachment URL.
* @type string $class CSS class name or space-separated list of classes. * @type string $class CSS class name or space-separated list of classes.
* Default `attachment-$size_class size-$size_class`, * Default `attachment-$size_class size-$size_class`,
* where `$size_class` is the image size being requested. * where `$size_class` is the image size being requested.
* @type string $alt Image description for the alt attribute. * @type string $alt Image description for the alt attribute.
* @type string $srcset The 'srcset' attribute value. * @type string $srcset The 'srcset' attribute value.
* @type string $sizes The 'sizes' attribute value. * @type string $sizes The 'sizes' attribute value.
* @type string|false $loading The 'loading' attribute value. Passing a value of false * @type string|false $loading The 'loading' attribute value. Passing a value of false
* will result in the attribute being omitted for the image. * will result in the attribute being omitted for the image.
* Defaults to 'lazy', depending on wp_lazy_loading_enabled(). * Default determined by {@see wp_get_loading_optimization_attributes()}.
* @type string $decoding The 'decoding' attribute value. Possible values are * @type string $decoding The 'decoding' attribute value. Possible values are
* 'async' (default), 'sync', or 'auto'. Passing false or an empty * 'async' (default), 'sync', or 'auto'. Passing false or an empty
* string will result in the attribute being omitted. * string will result in the attribute being omitted.
* @type string $fetchpriority The 'fetchpriority' attribute value, whether `high`, `low`, or `auto`.
* Default determined by {@see wp_get_loading_optimization_attributes()}.
* } * }
* @return string HTML img element or empty string on failure. * @return string HTML img element or empty string on failure.
*/ */

View File

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