Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#39628 closed enhancement (fixed)

add $post arg to display_media_states filter

Reported by: pbiron's profile pbiron Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 3.2
Component: Media Keywords: good-first-bug has-patch
Focuses: Cc:


It would be good to pass $post to the display_media_states filter, for several reasons:

  1. so that we don't have to rely on global $post being set appropriately
  2. to mirror the display_post_states filter

I started looking into this filter to get around a bug with the Logo state not being added when appropriate (see Ticket 39627), and it took me a while to realize that I could key off of global $post to know whether Logo should be added to $media_states.

Attachments (1)

39628.diff (671 bytes) - added by chriseverson 6 years ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
6 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from trunk to 3.2

6 years ago

#2 @chriseverson
6 years ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
6 years ago

  • Milestone changed from Future Release to 4.8

#4 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 39926:

Media: Pass the current attachment object to display_media_states filter, for consistency with display_post_states.

Props pbiron, chriseverson.
Fixes #39628.

Note: See TracTickets for help on using tickets.