WordPress at a glance

get_current_screen() WP 1.0

Get the current screen object

Works based on: WP_Screen()
1 time = 0.000016s = very fast | 50000 times = 0.01s = speed of light

No Hooks.

Return

WP_Screen/null. Current screen object or null when screen not defined.

Usage

get_current_screen();

Notes

  • Global. WP_Screen. $current_screen WordPress current screen object.

Changelog

Since 3.1.0 Introduced.

Code of get_current_screen() WP 5.5.1

<?php
function get_current_screen() {
	global $current_screen;

	if ( ! isset( $current_screen ) ) {
		return null;
	}

	return $current_screen;
}

From category: Admin Menu

No comments
    Log In . Register