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

WordPress Trac noreply at wordpress.org
Sun Nov 11 19:08:30 UTC 2012


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

Comment (by nacin):

 Here's the results of an audit of all hooks in wp-
 admin/includes/media.php. The big stuff is already handled. Some of these
 can simply fall by the wayside, while others might deserve a shim.

 A lot of admin/includes/media.php was rendered in some way obsolete in 3.3
 when the media buttons were merged into one (#17578) and Plupload was
 introduced.

 Filters tied to the old dialog:

  * '''media_upload_tabs''' — handled
  * '''media_upload_default_tab''' — could be supported if we wanted, but
 isn't really relevant anymore, and appears unused by plugins
  * '''media_buttons_context''' — no longer relevant, this was the
 "Upload/Insert" label
  * '''{$type}_upload_iframe_src''' — no longer relevant
  * '''media_upload_form_url''' — bunch of filters on "media-upload.php"
  * '''get_media_item_args''' — could be used to decide whether certain
 things were displayed for an item, including "Insert into Post" and a
 "Delete" link. We can support these via get_compat_media_markup()
  * '''type_url_form_media''' — chunk of html for "Embed from URL", no need
 to support
  * '''media_upload_mime_type_links''' — mime-based filter links, which we
 could support

 Filters for attachment data:
  * '''image_size_names_choose'''
  * '''attachment_fields_to_save''' — handled
  * '''attachment_fields_to_edit''' — handled
  * '''media_meta''' — handled

 Filters for sending to the editor:
  * '''{$type}_send_to_editor_url''' (type = file, audio, or video) — used
 when inserting a non-image from an external URL
  * '''image_send_to_editor_url''' — this is nearly always bypassed
 already, thanks to addExtImage in JS

  * '''disable_captions''' — we should support this. Note, we only check it
 for post insertion itself: for whether it reaches the editor, and whether
 the field is shown for "from URL" insertion for images. The caption field
 is not otherwise hidden in the media library

 Filters for "Insert into Post":
  * '''media_send_to_editor''' — fires for anything inserted into the post
  * '''image_send_to_editor''' — fires for any images inserted into the
 post (get_image_send_to_editor() is hooked into media_send_to_editor, via
 image_media_send_to_editor())
  * '''image_add_caption_shortcode''' — adds the caption shortcode for any
 images inserted into the post (inside image_add_caption(), which is hooked
 into image_send_to_editor)

 Upload UI filters:
  * '''upload_post_params''' (new in 3.3) — pretty much inescapably tied to
 the old uploader, not much we can do here unless we wanted to support
 routing to old-style tabs
  * '''plupload_init''' (new in 3.3) — the plupload_default_settings hook
 seems sufficient. array_merging these seems like it would cause more harm
 than good

 Upload UI actions:

  * '''upload_ui_over_quota''' (new in 3.5)
  * '''pre-upload-ui'''
  * '''pre-plupload-upload-ui''' (new in 3.3)
  * '''post-plupload-upload-ui''' (new in 3.3, used to display "use the
 browser uploader?")
  * '''pre-html-upload-ui'''
  * '''post-html-upload-ui''' (used to display "use the multi-file
 uploader?")
  * '''post-upload-ui''' (used to display "you can add titles and
 descriptions", which is useless)

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


More information about the wp-trac mailing list