[wp-trac] [WordPress Trac] #59542: Duplicate default statement in wp_get_attachment_image_src() documentation

WordPress Trac noreply at wordpress.org
Wed Jan 17 10:34:54 UTC 2024


#59542: Duplicate default statement in wp_get_attachment_image_src() documentation
--------------------------+------------------------------
 Reporter:  crstauf       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+------------------------------

Comment (by SergeyBiryukov):

 Replying to [ticket:59542 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
 [https://developer.wordpress.org/reference/functions/count_user_posts/
 count_user_posts()] page, but `Default:  false` is not.

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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59542#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list