Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #23148, comment 40


Ignore:
Timestamp:
02/27/2023 10:07:32 PM (13 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23148, comment 40

    v1 v2  
    44That'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.
    55
    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` ) ) ...
     6It 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' ) ) ...`
    77
    88> I continue to believe this action would offer an official way to hook into that flow.