Skip to Content
Menu

is_admin_page()

An alias of the WordPress function is_admin() for a less confusing syntax.

PHP April 27, 2017

Usage

PHP
nebula()->is_admin_page()

Parameters

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

Additional Notes

Returns true if viewing an admin page, otherwise returns false. This does not check if the user is an admin!

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 146.

    No Hooks

    This function does not have any filters or actions available. Request one?
    PHP
            public function is_admin_page($include_customizer=false, $include_login=false){
                if ( is_admin() ){
                    return true;
                }
    
                if ( $include_customizer && is_customize_preview() ){
                    return true;
                }
    
                if ( $include_login && $this->is_login_page() ){
                    return true;
                }
    
                return false;
            }
    

    Override

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