set_current_screen

Set the current screen object.

Description

set_current_screen( (string) $hook_name = '' ); 

Parameters (1)

0. $hook_name — Optional. (string) => ''
The hook name (also known as the hook suffix) used to determine the screen, or an existing screen object.

Usage

  1. if ( !function_exists( 'set_current_screen' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/screen.php'; 
  3.  
  4. // Optional. The hook name (also known as the hook suffix) used to determine the screen, 
  5. // or an existing screen object. 
  6. $hook_name = ''; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = set_current_screen($hook_name); 
  10.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/screen.php  
  1. function set_current_screen( $hook_name = '' ) { 
  2. WP_Screen::get( $hook_name )->set_current_screen();