WP_Screen::set_current_screen()publicWP 3.3.0

Makes the screen object the current screen.

Method of the class: WP_Screen{}

Hooks from the method

Return

null. Nothing (null).

Usage

$WP_Screen = new WP_Screen();
$WP_Screen->set_current_screen();

Notes

  • See: set_current_screen()
  • Global. WP_Screen. $current_screen WordPress current screen object.
  • Global. String. $typenow The post type of the current screen.
  • Global. String. $taxnow The taxonomy of the current screen.

Changelog

Since 3.3.0 Introduced.

WP_Screen::set_current_screen() code WP 6.5.2

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 );
}