$current_screen WordPress Global Variable

For highly customized WordPress installations is can be useful to have specific instructions in usage for specific pages. These instructions could be in the form of a FAQ, a step-by-step instruction list, a helpful flash-animation, there are several options available.

For specific targeting of instructions we can use  $current_screen to detect where the user is.


I stumbled into the $current_screen global variable by chance, looking for something else in the WordPress source code. This little documented global variable contains information about which page specifically you are currently viewing in the WordPress administration interface.

Using this variable you can either embed the necessary code in a plugin, or as I prefer, modify the WordPress theme’s functions.php file.

Example Code

add_action('admin_notices', 'notifications');

* notifications() - Administration Header Instructions and Notifications
function notifications() {
global $current_screen;

if ($current_screen->id=='dashboard') ) {
echo "<div id='notice_dashboard' class='updated fade'><p>Welcome to your blog!</p></div>";

Welcome to your blog!

The code above shows a simple “Welcome to your blog!” if you are on the dashboard page. You can target other specific pages by changing the look-up on $current_screen->id to another value. You can use the reference table I created below.

Notice that I have added a unique css id identifier to the the <div>-tag. By doing this it I am able to style pages individually if I need to.

Another example usage could be to remind authors to make sure they have chosen a category and tagged posts before they publish.

if ($current_screen-&amp;gt;id=='post') ) {
			echo &amp;quot;&amp;lt;div id='notice_post' class='updated fade'&amp;gt;&amp;lt;p&amp;gt;Please remember to choose both a CATEGORY and to TAG the post before you publish!&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;;

Reference Table

I created the following reference table to help other developers who want to create super targeted instructions in their WordPress installations.

Main Menu Submenu $current_screen->id
Super Admin ms-admin
Sites ms-sites
Users ms-users
Themes ms-themes
Options ms-options
Update ms-upgrade-network
Dashbord dashboard
My Sites my-sites
Updates update-core
Posts edit-post
Add New post
Categories edit-category
Post Tags edit-post_tag
Library upload
Add New media
Links link-manager
Add New link
Link Categories edit-link-categories
Pages edit-page
Add New page
Comments edit-comments
Themes (Manage) themes
Themes (install) theme-install
Widgets widgets
Menus nav-menus
Editor theme-editor
Plugins plugins
Add New plugin-install
Editor plugin-editor
Users users
Add New user
Your Profile profile
Tools tools
Import import
Export export
Network network
General options-general
Writing options-writing
Reading options-reading
Discussion options-discussion
Media options-media
Privacy options-privacy
Permalinks options-permalink