A WordPress-centric search engine for devs and theme authors



is_admin ›

Since1.5.1
Deprecatedn/a
is_admin ( No parameters )
Returns:
  • (bool) True if inside WordPress administration interface, false otherwise.
Defined at:
Codex:

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.



Source

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

	return false;
}