Make WordPress Core

Ticket #51463: pre-ajax-action.patch

File pre-ajax-action.patch, 684 bytes (added by DavidAnderson, 4 years ago)

Add "pre_wp_ajax" action call

  • wp-admin/admin-ajax.php

     
    159159
    160160$action = ( isset( $_REQUEST['action'] ) ) ? $_REQUEST['action'] : '';
    161161
     162/**
     163 * Fires before all AJAX actions - including ones that are not hooked and will not ultimately get fired.
     164 *
     165 * @since 5.6.0
     166 *
     167 * @param string $action The name of the invoked Ajax action callback.
     168 */
     169do_action( "pre_wp_ajax" , $action );
     170
    162171if ( is_user_logged_in() ) {
    163172        // If no action is registered, return a Bad Request response.
    164173        if ( ! has_action( "wp_ajax_{$action}" ) ) {