Title: function get_current_screen Can it use by themes/functions.php?
Last modified: August 20, 2016

---

# function get_current_screen Can it use by themes/functions.php?

 *  [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/function-get_current_screen-can-it-use-by-themesfunctionsphp/)
 * If this code is written, an error will occur. WordPress version 3.3 rc2 single
 *     ```
       $screen = get_current_screen();
       ```
   
 * Above code create the error log below.
 * > [11-Dec-2011 09:32:08] PHP Fatal error: Call to undefined function get_current_screen()
   > in /virtual/example/public_html/wp/wp-content/themes/twentyeleven/functions.
   > php on line 596
 * WordPress function get_current_screen was exists where wp-admin/includes/screen.
   php.
 * But not included where functions.php
 * check code:
 *     ```
       $included_files = get_included_files();
        var_dump($included_files);
       ```
   
 * result
    theme/functions.php 134files included not exists wp-admin/includes/screen.
   php wp-admin/index.php 168files included exists wp-admin/includes/screen.php 
   wp-admin/themes.php 167 files included exists wp-admin/includes/screen.php
 * Please tell me How do I use this WordPress function?
 * Thank you

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Big Bagel](https://wordpress.org/support/users/big-bagel/)
 * (@big-bagel)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/function-get_current_screen-can-it-use-by-themesfunctionsphp/#post-2440961)
 * Unless I’m mistaken, `get_current_screen` is only intended for use when showing
   an administration screen. Its function is to return the current screen’s [hook suffix](http://codex.wordpress.org/Administration_Menus#Page_Hook_Suffix).
   If you want to explain what you’re trying to do, I (or someone) might be able
   to provide a good alternative.
 *  Thread Starter [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/function-get_current_screen-can-it-use-by-themesfunctionsphp/#post-2441009)
 * Hi Big Bagel
 * I’m resolved
 * My last test code works fine
 * Thank you.
 *     ```
       add_action('admin_menu', 'my_theme_menu');
       function my_theme_menu() {
       	$theme_page= add_theme_page('My Theme Options','test','edit_theme_options','myslug','my_Theme_options');
       	if ( $theme_page ){	add_action( 'load-' . $theme_page, 'my_help_tabs_to_theme_page' );}
       }
       function my_theme_options() {
       	echo '<div class="wrap"><p>This is Theme Options page</p></div>';
       }
       function my_help_tabs_to_theme_page() {
       	$screen = get_current_screen();
       	$screen -> add_help_tab(array('id' => 'additional-plugin-help','title' => 'Special Instructions','content' => '<p>This is the content for the tab.</p>'));
       }
       ```
   
 *  [Junior Grao](https://wordpress.org/support/users/junior-grao/)
 * (@junior-grao)
 * [14 years ago](https://wordpress.org/support/topic/function-get_current_screen-can-it-use-by-themesfunctionsphp/#post-2441316)
 * Hi, nobita
 * Enter in file functions.php and try to copy this:
 * function get_current_screen() {
    global $current_screen;
 *  if ( ! isset( $current_screen ) )
    return null;
 *  return $current_screen;
    }
 * Bests

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘function get_current_screen Can it use by themes/functions.php?’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Junior Grao](https://wordpress.org/support/users/junior-grao/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/function-get_current_screen-can-it-use-by-themesfunctionsphp/#post-2441316)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
