WP_Screen::in_admin()publicWP 3.5.0

Indicates whether the screen is in a particular admin.

Method of the class: WP_Screen{}

No Hooks.


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


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


Since 3.5.0 Introduced.

WP_Screen::in_admin() code WP 6.5.4

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

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