Get the current screen object
function get_current_screen() {
global $current_screen;
if ( ! isset( $current_screen ) ) {
return null;
}
return $current_screen;
}
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_current_screen