Opened 2 years ago
Last modified 22 months ago
#59542 new defect (bug)
Duplicate default statement in wp_get_attachment_image_src() documentation
| Reported by: |
|
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.
2 years ago
#1
- Keywords has-patch added
#2
@
22 months 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
@
22 months 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.
Trac ticket: https://core.trac.wordpress.org/ticket/59542