is_admin

The timeline below displays how wordpress function is_admin has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.3

/**
 * Determines whether the current request is for an administrative interface page.
 *
 * Does not check if the user is an administrator; use current_user_can()
 * for checking roles and capabilities.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 1.5.1
 *
 * @global WP_Screen $current_screen WordPress current screen object.
 *
 * @return bool True if inside WordPress administration interface, false otherwise.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}

WordPress Version: 5.1

/**
 * Determines whether the current request is for an administrative interface page.
 *
 * Does not check if the user is an administrator; use current_user_can()
 * for checking roles and capabilities.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 1.5.1
 *
 * @global WP_Screen $current_screen
 *
 * @return bool True if inside WordPress administration interface, false otherwise.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}

WordPress Version: 5.0

/**
 * Determines whether the current request is for an administrative interface page.
 *
 * Does not check if the user is an administrator; current_user_can()
 * for checking roles and capabilities.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
 * Conditional Tags} article in the Theme Developer Handbook. 
 *
 * @since 1.5.1
 *
 * @global WP_Screen $current_screen
 *
 * @return bool True if inside WordPress administration interface, false otherwise.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}

WordPress Version: 4.6

/**
 * Whether the current request is for an administrative interface page.
 *
 * Does not check if the user is an administrator; current_user_can()
 * for checking roles and capabilities.
 *
 * @since 1.5.1
 *
 * @global WP_Screen $current_screen
 *
 * @return bool True if inside WordPress administration interface, false otherwise.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}

WordPress Version: 4.3

/**
 * Whether the current request is for an administrative interface page.
 *
 * Does not check if the user is an administrator; {@see current_user_can()}
 * for checking roles and capabilities.
 *
 * @since 1.5.1
 *
 * @global WP_Screen $current_screen
 *
 * @return bool True if inside WordPress administration interface, false otherwise.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}

WordPress Version: 4.0

/**
 * Whether the current request is for an administrative interface page.
 *
 * Does not check if the user is an administrator; {@see current_user_can()}
 * for checking roles and capabilities.
 *
 * @since 1.5.1
 *
 * @return bool True if inside WordPress administration interface, false otherwise.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}

WordPress Version: 3.7

/**
 * Whether the current request is for a network or blog admin page
 *
 * Does not inform on whether the user is an admin! Use capability checks to
 * tell if the user should be accessing a section or not.
 *
 * @since 1.5.1
 *
 * @return bool True if inside WordPress administration pages.
 */
function is_admin()
{
    if (isset($GLOBALS['current_screen'])) {
        return $GLOBALS['current_screen']->in_admin();
    } elseif (defined('WP_ADMIN')) {
        return WP_ADMIN;
    }
    return false;
}