Skip to Content

is_ajax_request()

Detect if a request is coming from AJAX.

PHP June 18, 2017

Usage

PHP
nebula()->is_ajax_request()

Parameters

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

Source File

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

No Hooks

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

            return false;
        }

Override

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