Changes between Version 1 and Version 2 of Ticket #23148, comment 40
- Timestamp:
- 02/27/2023 10:07:32 PM (13 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23148, comment 40
v1 v2 4 4 That's not entirely true. There's the `DOING_AJAX` and even `wp_doing_ajax()`. Also all WP AJAX calls are done from hooks, see https://core.trac.wordpress.org/browser/tags/6.1/src/wp-admin/admin-ajax.php#L104 and https://core.trac.wordpress.org/browser/tags/6.1/src/wp-admin/admin-ajax.php#L164. 5 5 6 It seems it is quite easy to determine when `wp_ajax_save_attachment()` was used without having a new action. My favorite would be: `if ( doing_action( `wp_ajax_save-attachment` ) ) ...6 It seems it is quite easy to determine when `wp_ajax_save_attachment()` was used without having a new action. My favorite would be: `if ( doing_action( 'wp_ajax_save-attachment' ) ) ...` 7 7 8 8 > I continue to believe this action would offer an official way to hook into that flow.