if ( wp_doing_ajax() ) { /**
* Filters the callback for killing WordPress execution for Ajax requests.
*
* @since 3.4.0
*
* @param callable $callback Callback function name.
*/
$callback =
apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler'
);
} elseif ( wp_is_json_request() ) { /**
* Filters the callback for killing WordPress execution for JSON requests.
*
* @since 5.1.0
*
* @param callable $callback Callback function name.
*/
$callback =
apply_filters( 'wp_die_json_handler', '_json_wp_die_handler'
);
} elseif ( defined( 'REST_REQUEST'
) && REST_REQUEST &&
wp_is_jsonp_request() ) { /**
* Filters the callback for killing WordPress execution for JSONP REST requests.
*
* @since 5.2.0
*
* @param callable $callback Callback function name.
*/