[wp-trac] [WordPress Trac] #23148: Add hook in wp_ajax_save_attachment for additional attachment fields

WordPress Trac noreply at wordpress.org
Mon Feb 27 17:41:47 UTC 2023


#23148: Add hook in wp_ajax_save_attachment for additional attachment fields
-----------------------------------+-----------------------
 Reporter:  griffinjt              |       Owner:  audrasjb
     Type:  enhancement            |      Status:  reopened
 Priority:  normal                 |   Milestone:  6.2
Component:  Media                  |     Version:  3.5
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+-----------------------

Comment (by sc0ttkclark):

 @azaozz Without this action, we have no way to know that an attachment was
 added through the `wp_ajax_save_attachment()` call except to sniff what we
 can from request vars. I continue to believe this action would offer an
 official way to hook into that flow.

 I know you know that no traction on Trac tickets does not always correlate
 to the usefulness of the ticket. In this case, I believe that is because
 this is in an area that's less often dealt with: Attachment fields. The
 cool story here is that there was a hook for this
 `attachment_fields_to_save` that helped but that's for the legacy media
 handling. The action implemented here allows for that and many other use-
 cases stemming from the AJAX save_attachment action.

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


More information about the wp-trac mailing list