set_current_screen() WordPress Function

This function is used to set the current screen object. This is most useful when developing new admin screens or customizing existing ones. It is called before the screen is rendered.

set_current_screen( string|WP_Screen $hook_name = '' ) #

Set the current screen object


Parameters

$hook_name

(string|WP_Screen)(Optional) The hook name (also known as the hook suffix) used to determine the screen, or an existing screen object.

Default value: ''


Top ↑

Source

File: wp-admin/includes/screen.php

function set_current_screen( $hook_name = '' ) {
	WP_Screen::get( $hook_name )->set_current_screen();
}


Top ↑

Changelog

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