WP_Screen::in_admin() WordPress Method

The WP_Screen::in_admin() method is used to check whether the current screen is in the admin interface.

WP_Screen::in_admin( string $admin = null ) #

Indicates whether the screen is in a particular admin


Parameters

$admin

(string)(Optional)The admin to check against (network | user | site). If empty any of the three admins will result in true.

Default value: null


Top ↑

Return

(bool) True if the screen is in the indicated admin, false otherwise.


Top ↑

Source

File: wp-admin/includes/class-wp-screen.php

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

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

Top ↑

Changelog

Changelog
VersionDescription
3.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.