Make WordPress Core

Opened 5 months ago

Last modified 7 weeks ago

#59542 new defect (bug)

Duplicate default statement in wp_get_attachment_image_src() documentation

Reported by: crstauf's profile crstauf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

I suspect this is a result of the default value being added to the parameter's description. Removing from the parameter's description will allow the default value to be retrieved from the function argument's list without duplication.

Documentation:
https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/

Reported by @vitzkrieg via User Contributed Notes.

Change History (3)

This ticket was mentioned in PR #5407 on WordPress/wordpress-develop by @crstauf.


5 months ago
#1

  • Keywords has-patch added

#2 @audrasjb
7 weeks ago

Thanks for the ticket and patch @crstauf. However, I can't figure out why it doesn't affect the $icon parameter located just below… 🤔

#3 in reply to: ↑ description @SergeyBiryukov
7 weeks ago

Replying to crstauf:

I suspect this is a result of the default value being added to the parameter's description. Removing from the parameter's description will allow the default value to be retrieved from the function argument's list without duplication.

Hi there, thanks for the ticket!

Unless I'm missing something, the default value is indeed always retrieved from the parameter's description and not from the function arguments list, so the DocBlock is correct as is.

I noticed that the issue is not specific to this function, it appears to happen with any string value defaults, for example Default: 'post' is duplicated on the count_user_posts() page, but Default: false is not.

I think the issue might be in the DevHub documentation parser.

Note: See TracTickets for help on using tickets.