[wp-trac] [WordPress Trac] #17580: get_media_item(): add filter to better control "buttons" in media upload and make more performant if buttons are already set

WordPress Trac wp-trac at lists.automattic.com
Thu May 26 23:08:45 UTC 2011


#17580: get_media_item(): add filter to better control "buttons" in media upload
and make more performant if buttons are already set
-----------------------------+-----------------------------
 Reporter:  mitchoyoshitaka  |      Owner:  mitchoyoshitaka
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Performance      |    Version:
 Severity:  normal           |   Keywords:  has-patch
-----------------------------+-----------------------------
 Two issues in get_media_item():
 1. There's no good, clean way to modify the "buttons" (things which get
 stored lumped together in $form_fields["buttons"]) in the Media Upload,
 except for the "delete" and "send" (aka "insert into post") which can be
 controlled via the 'get_media_item_args'. Add a filter for that.
 2. Right now we construct the HTML snippets for different buttons, as
 $send, $delete, and $thumbnail... and then checking whether
 $form_fields["buttons"] is already set or not, and then only using them if
 it's not already set. If a plugin already pre-specifies the buttons HTML,
 this computation is completely wasteful. Move this conditional earlier.
 3. (Terribly minor:) If any of these buttons aren't actually used, <td
 class='savesend'/> is produced with extra whitespace in it. This is a
 reflection of the poor design of the code which prints this HTML.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17580>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list