Make WordPress Core

Opened 3 months ago

Closed 3 months ago

#53878 closed enhancement (fixed)

Return type not matched in PHPDoc - Bundled Themes

Reported by: ankitmaru Owned by: SergeyBiryukov
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch dev-feedback
Focuses: docs, coding-standards Cc:


Return type not matched in PHPDoc - Bundled Themes

Attachments (1)

return-type-not-matched-phpdoc-template-functions.php_53878.patch (640 bytes) - added by ankitmaru 3 months ago.

Download all attachments as: .zip

Change History (5)

#1 @mukesh27
3 months ago

  • Keywords dev-feedback added

Hi, Thanks for the ticket and patch!

Each bundle theme has different return value docs for the same filter so I think we have to set a unique document for in the filter.

Twenty Sixteen - https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentysixteen/functions.php#L565
Twenty Seventeen - https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentyseventeen/functions.php#L579

* @return array The filtered attributes for the image markup. 

Twenty Nineteen - https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentynineteen/inc/template-functions.php#L104

* @return string Value for use in post thumbnail 'sizes' attribute. 

Twenty Twenty-One - https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentytwentyone/inc/template-functions.php#L440

* @return array 

#2 @ankitmaru
3 months ago

@mukesh27 Please guide me for the same.
Thanks for getting back very quickly 😀.

#3 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 5.9

#4 @SergeyBiryukov
3 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 51607:

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.

Note: See TracTickets for help on using tickets.