Docs: Synchronize documentation for `wp_get_attachment_image_attributes` filter callbacks in bundled themes:

* Twenty Sixteen: Correct the `$attachment` parameter type, use typed array notation.
* Twenty Seventeen: Correct the `$attachment` parameter type, use typed array notation.
* Twenty Nineteen: Correct the `@return` value type, use typed array notation.
* Twenty Twenty-One: Add missing `@return` value description, use typed array notation.

Follow-up to [29836], [47249], [49021], [49597].

Props ankitmaru, mukesh27, SergeyBiryukov.
Fixes #53878.
Built from https://develop.svn.wordpress.org/trunk@51607


git-svn-id: http://core.svn.wordpress.org/trunk@51218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-08-12 19:30:57 +00:00
parent 0984eca703
commit a2a8b77806
5 changed files with 21 additions and 16 deletions

View File

@ -96,12 +96,13 @@ function twentynineteen_get_the_archive_title() {
add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' );
/**
* Add custom sizes attribute to responsive image functionality for post thumbnails.
* Add custom 'sizes' attribute to responsive image functionality for post thumbnails.
*
* @origin Twenty Nineteen 1.0
*
* @param array $attr Attributes for the image markup.
* @return string Value for use in post thumbnail 'sizes' attribute.
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
* See wp_get_attachment_image().
* @return string[] The filtered attributes for the image markup.
*/
function twentynineteen_post_thumbnail_sizes_attr( $attr ) {

View File

@ -573,10 +573,12 @@ add_filter( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 );
*
* @since Twenty Seventeen 1.0
*
* @param array $attr Attributes for the image markup.
* @param int $attachment Image attachment ID.
* @param array $size Registered image size or flat array of height and width dimensions.
* @return array The filtered attributes for the image markup.
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
* See wp_get_attachment_image().
* @param WP_Post $attachment Image attachment post.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @return string[] The filtered attributes for the image markup.
*/
function twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {
if ( is_archive() || is_search() || is_home() ) {

View File

@ -559,10 +559,12 @@ add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr'
*
* @since Twenty Sixteen 1.0
*
* @param array $attr Attributes for the image markup.
* @param int $attachment Image attachment ID.
* @param array $size Registered image size or flat array of height and width dimensions.
* @return array The filtered attributes for the image markup.
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
* See wp_get_attachment_image().
* @param WP_Post $attachment Image attachment post.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @return string[] The filtered attributes for the image markup.
*/
function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {
if ( 'post-thumbnail' === $size ) {

View File

@ -432,12 +432,12 @@ add_filter( 'the_password_form', 'twenty_twenty_one_password_form', 10, 2 );
*
* @since Twenty Twenty-One 1.0
*
* @param array $attr Array of attribute values for the image markup, keyed by attribute name.
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
* See wp_get_attachment_image().
* @param WP_Post $attachment Image attachment post.
* @param string|array $size Requested size. Image size or array of width and height values
* (in that order). Default 'thumbnail'.
* @return array
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @return string[] The filtered attributes for the image markup.
*/
function twenty_twenty_one_get_attachment_image_attributes( $attr, $attachment, $size ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51606';
$wp_version = '5.9-alpha-51607';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.