[wp-trac] [WordPress Trac] #23148: Add hook in wp_ajax_save_attachment for additional attachment fields
WordPress Trac
noreply at wordpress.org
Mon Mar 6 00:46:50 UTC 2023
#23148: Add hook in wp_ajax_save_attachment for additional attachment fields
-------------------------------------------------+-------------------------
Reporter: griffinjt | Owner: audrasjb
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.2
Component: Media | Version: 3.5
Severity: normal | Resolution: fixed
Keywords: has-patch 2nd-opinion dev-feedback | Focuses:
needs-dev-note needs-docs |
-------------------------------------------------+-------------------------
Changes (by azaozz):
* keywords: has-patch 2nd-opinion dev-feedback needs-dev-note => has-patch
2nd-opinion dev-feedback needs-dev-note needs-docs
Comment:
Replying to [comment:42 sc0ttkclark]:
> I'll be implementing this in Pods Framework
Sorry but I'm still struggling to understand why the `attachment_updated`
hook cannot be used in this case. Would be really helpful if you could
provide some more info:
1. An example or a link to some existing code that will be replaced when
this action becomes available.
2. Brief explanation why it is not possible to use `attachment_updated`
with `doing_action( 'wp_ajax_save-attachment' )`.
As far as I see `wp_ajax_save_attachment_updated` is a duplicate of
`attachment_updated`.
Guessing that the reported was not aware of the `wp_ajax_save-attachment`
action and the possibility to use `doing_action( 'wp_ajax_save-attachment'
)`. However it seems that when attempting to modify the saving of an
attachment, one of the other hooks
([https://core.trac.wordpress.org/ticket/23148?replyto=42#comment:52
mentioned in the previous comment]) will have to be used anyway. This
seems limit even further the usefulness of the new
`wp_ajax_save_attachment_updated`.
Also, are you going to be writing the dev. note? Could you also include
[https://core.trac.wordpress.org/ticket/23148?replyto=42#comment:52 the
above list of other hooks] that are triggered. I'll make sure add them to
the docblock and link to this ticket for further reference.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23148#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list