mirror of
git://develop.git.wordpress.org/
synced 2025-04-16 10:02:20 +02:00
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
This commit is contained in:
parent
6406dbaca8
commit
eb6b517aec
@ -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 ) {
|
||||
|
||||
|
@ -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() ) {
|
||||
|
@ -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 ) {
|
||||
|
@ -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 ) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user