screen_options_show_screen

Filters whether to show the Screen Options tab.

Description

apply_filters( 'screen_options_show_screen', (bool) $show_screen, (WP_Screen) $instance ); 

Parameters (2)

0. $show_screen (bool)
Whether to show Screen Options tab. Default true.
1. $instance (WP_Screen)
Current WP_Screen instance.

Usage

To run the hook, copy the example below.
  1. $show_screen = apply_filters( 'screen_options_show_screen', $show_screen, $instance ); 
  2.  
  3. if ( !empty( $show_screen ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the screen_options_show_screen callback 
  2. function filter_screen_options_show_screen( $show_screen, $instance ) { 
  3. // make filter magic happen here... 
  4. return $show_screen
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'screen_options_show_screen', 'filter_screen_options_show_screen', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'screen_options_show_screen', 'filter_screen_options_show_screen', 10, 2 ); 

Defined (2)

The filter is defined in the following location(s).

/wp-admin/includes/class-wp-screen.php  
  1. $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this ); 
/wp-admin/nav-menus.php  
  1. add_filter( 'screen_options_show_screen', '__return_false' );