WordPress at Your Fingertips
function is not described

WP_Screen::in_admin() public WP 3.5.0

Indicates whether the screen is in a particular admin

{} It's a method of the class: WP_Screen{}

No Hooks.

Return

true|false. True if the screen is in the indicated admin, false otherwise.

Usage

$WP_Screen = new WP_Screen();
$WP_Screen->in_admin( $admin );
$admin(string)
The admin to check against (network | user | site). If empty any of the three admins will result in true.
Default: null

Changelog

Since 3.5.0 Introduced.

Code of WP_Screen::in_admin() WP 5.8.2

public function in_admin( $admin = null ) {
	if ( empty( $admin ) ) {
		return (bool) $this->in_admin;
	}

	return ( $admin === $this->in_admin );
}