Skip to content

Commit eb6b517

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51607 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6406dba commit eb6b517

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

src/wp-content/themes/twentynineteen/inc/template-functions.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ function twentynineteen_get_the_archive_title() {
9696
add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' );
9797

9898
/**
99-
* Add custom sizes attribute to responsive image functionality for post thumbnails.
99+
* Add custom 'sizes' attribute to responsive image functionality for post thumbnails.
100100
*
101101
* @origin Twenty Nineteen 1.0
102102
*
103-
* @param array $attr Attributes for the image markup.
104-
* @return string Value for use in post thumbnail 'sizes' attribute.
103+
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
104+
* See wp_get_attachment_image().
105+
* @return string[] The filtered attributes for the image markup.
105106
*/
106107
function twentynineteen_post_thumbnail_sizes_attr( $attr ) {
107108

src/wp-content/themes/twentyseventeen/functions.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,12 @@ function twentyseventeen_header_image_tag( $html, $header, $attr ) {
573573
*
574574
* @since Twenty Seventeen 1.0
575575
*
576-
* @param array $attr Attributes for the image markup.
577-
* @param int $attachment Image attachment ID.
578-
* @param array $size Registered image size or flat array of height and width dimensions.
579-
* @return array The filtered attributes for the image markup.
576+
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
577+
* See wp_get_attachment_image().
578+
* @param WP_Post $attachment Image attachment post.
579+
* @param string|int[] $size Requested image size. Can be any registered image size name, or
580+
* an array of width and height values in pixels (in that order).
581+
* @return string[] The filtered attributes for the image markup.
580582
*/
581583
function twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {
582584
if ( is_archive() || is_search() || is_home() ) {

src/wp-content/themes/twentysixteen/functions.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,12 @@ function twentysixteen_content_image_sizes_attr( $sizes, $size ) {
559559
*
560560
* @since Twenty Sixteen 1.0
561561
*
562-
* @param array $attr Attributes for the image markup.
563-
* @param int $attachment Image attachment ID.
564-
* @param array $size Registered image size or flat array of height and width dimensions.
565-
* @return array The filtered attributes for the image markup.
562+
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
563+
* See wp_get_attachment_image().
564+
* @param WP_Post $attachment Image attachment post.
565+
* @param string|int[] $size Requested image size. Can be any registered image size name, or
566+
* an array of width and height values in pixels (in that order).
567+
* @return string[] The filtered attributes for the image markup.
566568
*/
567569
function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {
568570
if ( 'post-thumbnail' === $size ) {

src/wp-content/themes/twentytwentyone/inc/template-functions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,12 @@ function twenty_twenty_one_password_form( $output, $post = 0 ) {
432432
*
433433
* @since Twenty Twenty-One 1.0
434434
*
435-
* @param array $attr Array of attribute values for the image markup, keyed by attribute name.
435+
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
436436
* See wp_get_attachment_image().
437437
* @param WP_Post $attachment Image attachment post.
438-
* @param string|array $size Requested size. Image size or array of width and height values
439-
* (in that order). Default 'thumbnail'.
440-
* @return array
438+
* @param string|int[] $size Requested image size. Can be any registered image size name, or
439+
* an array of width and height values in pixels (in that order).
440+
* @return string[] The filtered attributes for the image markup.
441441
*/
442442
function twenty_twenty_one_get_attachment_image_attributes( $attr, $attachment, $size ) {
443443

0 commit comments

Comments
 (0)