[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:09:03 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:
------------------------------+-----------------------------

Comment (by whyisjake):

 In [changeset:"50040" 50040]:
 {{{
 #!CommitTicketReference repository="" revision="50040"
 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.

 This changeset brings [50039] to the 5.6 branch.

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

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


More information about the wp-trac mailing list