[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 22:53:58 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 changes-       |     Focuses:
  requested                                      |
-------------------------------------------------+-------------------------
Changes (by azaozz):

 * keywords:  has-patch 2nd-opinion => has-patch 2nd-opinion changes-
               requested


Comment:

 Replying to [comment:41 sc0ttkclark]:
 > developers looking to integrate in this area have been using workarounds
 to make it all work

 I wouldn't call using the `wp_ajax_save-attachment` action a workaround.
 It's rather the "right way to hook into any AJAX call".

 > They won't change it because their old solution works just fine for
 them.

 Yep, exactly.

 > But the new developers / projects, they have a chance at having a better
 life than us :)

 The question is about the balance: the maintenance "price" the WP project
 will have to pay vs. the minor convenience for few developers :)

 Actually thinking more about it the new `wp_ajax_save_attachment` action
 is almost a duplicate of the existing `wp_ajax_save-attachment` action,
 both in functionality and as "action name". This would probably be
 confusing.

 Still don't see a point in replacing `doing_action( 'wp_ajax_save-
 attachment' )` with `add_action( 'wp_ajax_save_attachment', ... )`, but if
 everybody thinks it is a good idea, lets keep it. However thinking the new
 action at least should have a better/different name to avoid possibility
 of confusion.

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


More information about the wp-trac mailing list