WP_Screen::set_current_screen() WordPress Method

The WP_Screen::set_current_screen() method sets the current screen object. This is useful for plugin and theme developers who need to know the current screen when working with the screen API.

WP_Screen::set_current_screen() #

Makes the screen object the current screen.


Description

Top ↑

See also


Top ↑

Source

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

	public function set_current_screen() {
		global $current_screen, $taxnow, $typenow;

		$current_screen = $this;
		$typenow        = $this->post_type;
		$taxnow         = $this->taxonomy;

		/**
		 * Fires after the current screen has been set.
		 *
		 * @since 3.0.0
		 *
		 * @param WP_Screen $current_screen Current WP_Screen object.
		 */
		do_action( 'current_screen', $current_screen );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.3.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.