[wp-trac] [WordPress Trac] #23148: Add hook in wp_ajax_save_attachment for additional attachment fields
WordPress Trac
noreply at wordpress.org
Wed Jul 27 20:20:28 UTC 2016
#23148: Add hook in wp_ajax_save_attachment for additional attachment fields
-------------------------+-----------------------
Reporter: griffinjt | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone:
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+-----------------------
Changes (by pputzer):
* status: closed => reopened
* resolution: wontfix =>
Comment:
@wonderboymusic That's probably because there still are no tutorials on
how to use the new Backbone API in plugins. The compat fields generated by
`attachment_fields_to_edit` are huge mess markup-wise and behave
completely differently because they get thrown into a `<table>`. I'm in
the process of converting my plugin (Media Credit) to the new API and
while it's possible to override yet another method on the JS side, it
would be far nicer to be able to hook in to the existing
`wp_ajax_save_attachment` action.
On a not-so-thorough first reading of the code, I thought I could use the
existing `wp_update_attachment_metadata` filter for this - until I noticed
it is only called for attachments of type `audio`:(
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23148#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list