[wp-trac] [WordPress Trac] #42063: Media: Indicate if image is used as a site option

WordPress Trac noreply at wordpress.org
Tue Oct 20 00:47:39 UTC 2020


#42063: Media: Indicate if image is used as a site option
-------------------------------------------------+-------------------------
 Reporter:  melchoyce                            |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  5.6
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots needs-     |     Focuses:  ui,
  refresh                                        |  administration
-------------------------------------------------+-------------------------
Changes (by garrett-eclipse):

 * keywords:  has-patch has-screenshots commit => has-patch has-screenshots
     needs-refresh


Comment:

 Replying to [comment:20 helen]:
 > 2. I'm not sure (or rather @markjaquith is not sure) that we should be
 adding the `$echo` param to `_media_states()` in this patch because it is
 not going to be used anywhere in core, and it's an internal function so it
 doesn't need to appeal to a wider use case. This is not yet reflected in
 the pull request.

 One thing to note is this is due to the implementation here is slightly
 off, instead of using get_post_states in the template we should be using
 `_media_states( $post, false )` to get them as a string that's already
 separated properly. Also the span should use `media-state` and not `post-
 state` for a class. So with this change the echo would then be used in
 core and is there for back-compat. Although these are meant to be internal
 functions when we looked at _post_states and just changing behaviour to
 echo by default we found it was used by plugins so that change wouldn't
 work well. Instead the new param is so we can change the core use without
 issues. Hope that helps make sense of it there.

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


More information about the wp-trac mailing list