[wp-trac] [WordPress Trac] #22186: Backwards compatibility for admin/includes/media.php hooks

WordPress Trac noreply at wordpress.org
Tue Nov 27 05:32:41 UTC 2012


#22186: Backwards compatibility for admin/includes/media.php hooks
--------------------------+------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  low           |   Milestone:  3.5
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------

Comment (by nacin):

 get_media_item_args is a filter on the arguments passed to
 get_media_item(), which are:
  * 'errors' => null
  * 'send' => $current_post_id ? post_type_supports( get_post_type(
 $current_post_id ), 'editor' ) : true
  * 'delete' => true
  * 'toggle' => true
  * 'show_title' => true

 '''errors''' is an array of potential errors that get passed from the
 handler to get_attachment_fields_to_edit(). We don't actually display (or
 pass along) these errors in the back compat code for 3.5. Hey, at least we
 handle the fields...

 '''send''' is a boolean, for whether the item should be given the
 opportunity to be sent to the editor. This was always simply "true" until
 3.0, when it then changed to whether the post type supported the editor,
 it seems for post-thumbnail purposes. It's also changed quite a bit over
 the years since being introduced in [6876] (and filtered since [16476]) —
 see [19350], [15920], [14146], [14118]). There's never been a core reason
 for "false". Plus, with the new view changes, supporting this really
 doesn't make much sense.

 '''delete''' is a way to specify if the delete link should show. It was
 set to false on media.php, which is now no longer exposed (#21391). We
 don't have delete links yet (#22524). If we did, this *could* be a reason
 to support this filter. But I don't think it will be missed.

 '''toggle''' is whether the panel should be able to be opened and closed
 (the accordion-style media items). This isn't relevant with the new UI.

 '''show_title''' was again used only on media.php. Not relevant with the
 new UI.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22186#comment:49>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list