WP_Screen::in_admin()publicWP 3.5.0

Indicates whether the screen is in a particular admin.

Метод класса: WP_Screen{}

Хуков нет.


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.
По умолчанию: null

Список изменений

С версии 3.5.0 Введена.

Код WP_Screen::in_admin() WP 6.2

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

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