Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#59542 new defect (bug)

Duplicate default statement in wp_get_attachment_image_src() documentation

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

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.


3 years ago
#1

  • Keywords has-patch added

#2 @audrasjb
3 years 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
3 years 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.