W3cubDocs

/WordPress

is_admin()

Determines whether the current request is for an administrative interface page.

Description

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 Conditional Tags article in the Theme Developer Handbook.

Return

(bool) True if inside WordPress administration interface, false otherwise.

Source

File: wp-includes/load.php

function is_admin() {
	if ( isset( $GLOBALS['current_screen'] ) ) {
		return $GLOBALS['current_screen']->in_admin();
	} elseif ( defined( 'WP_ADMIN' ) ) {
		return WP_ADMIN;
	}

	return false;
}

Changelog

Version Description
1.5.1 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_admin