Skip to Content
Menu

is_staff()

Check if the current visitor is a developer or a client by using their IP address or their WordPress user email domain (if they are logged in).

PHP April 27, 2017

Usage

PHP
nebula()->is_staff($strict)

Parameters

$strict
(Optional) (Boolean) Require the user to be logged-in
Default: None

Parameter Notes

Passing $strict as true bypasses the IP address condition and requires the user to be logged in and a developer or client.

Request or provide clarification »

Examples

PHP
<?php if ( is_staff() ){
    //Something for developers and clients only.
} ?>

Only show share counts in native social buttons to developers and clients.

PHP
<?php nebula_facebook_share(is_staff()); ?>

Additional Notes

Developers and clients IP addresses and email domains can be added in Nebula Options under the Administration tab.

For clarification, “client” in this context means the person or business for whom this website is being made. Any stakeholder who is not a developer should be added as a client in Nebula Options.

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

    No Hooks

    This function does not have any filters or actions available. Request one?
    PHP
            public function is_staff($strict=false){
                if ( $this->is_dev($strict) || $this->is_client($strict) ){
                    return true;
                }
    
                return false;
            }
    

    Override

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