Skip to Content
Menu

is_ajax_request()

Detect if a request is coming from AJAX.

PHP April 1, 2021

Usage

PHP
nebula()->is_ajax_request()

Parameters

This function does not accept any parameters. Is this incorrect?

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /libs/Utilities/Utilities.php on line 1170.

    No Hooks

    This function does not have any filters or actions available. Request one?
    PHP
            public function is_ajax_request(){
                if ( wp_doing_ajax() || (!empty($this->super->server['HTTP_X_REQUESTED_WITH']) && strtolower($this->super->server['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') ){
                    return true;
                }
    
                return false;
            }
    

    Override

    This function can not be short-circuited with an override filter. Request one?