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

WordPress Trac noreply at wordpress.org
Thu Jan 28 00:07:35 UTC 2021


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

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"50039" 50039]:
 {{{
 #!CommitTicketReference repository="" revision="50039"
 Media: Ensure that `wp_get_attachment_metadata` can return values from the
 global `$post`, if avaiable.

 In [49084] (for #50679), wp_get_attachment_metadata() was changed to
 improve performance, but it had the side effect of eliminating the ability
 to call it with no arguments and have it default to using the global
 $post.

 This change restores that ability, while keeping the performance
 improvements from the original change.

 Fixes #52196.

 Props cfinke, hellofromTonya, mukesh27, dilipbheda, Mista-Flo, audrasjb,
 SergeyBiryukov, whyisjake.
 }}}

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


More information about the wp-trac mailing list