WP_Screen::in_admin
Indicates whether the screen is in a particular admin.
Method of the class: WP_Screen{}
No Hooks.
Returns
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. |
WP_Screen::in_admin() WP Screen::in admin code WP 7.0
public function in_admin( $admin = null ) {
if ( empty( $admin ) ) {
return (bool) $this->in_admin;
}
return ( $admin === $this->in_admin );
}