[wp-trac] [WordPress Trac] #52196: wp_get_attachment_metadata() is broken if no first argument is passed in.

WordPress Trac noreply at wordpress.org
Fri Jan 1 04:40:07 UTC 2021


#52196: wp_get_attachment_metadata() is broken if no first argument is passed in.
--------------------------+-----------------------------
 Reporter:  cfinke        |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  5.6.1
Component:  Media         |     Version:  5.6
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by mukesh27):

 As per doc `@param int  $attachment_id Attachment post ID. Defaults to
 global $post.` default value for $attachment_id is `global $post` but in
 function use default value to 0.

 https://github.com/WordPress/WordPress/blob/master/wp-
 includes/post.php#L6075

 I think we have to change the doc block for that also? like

 `* @param int  $attachment_id Attachment post ID. Default 0.`

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


More information about the wp-trac mailing list