add_screen_option

Register and configure an admin screen option.

Description

add_screen_option( (string) $option, (array) $args = array() ); 

Parameters (2)

0. $option (string)
An option name.
1. $args — Optional. (array) => array()
Option-dependent arguments.

Usage

  1. if ( !function_exists( 'add_screen_option' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/screen.php'; 
  3.  
  4. // An option name. 
  5. $option = ''; 
  6.  
  7. // Option-dependent arguments. 
  8. $args = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = add_screen_option($option, $args); 
  12.  

Defined (1)

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

/wp-admin/includes/screen.php  
  1. function add_screen_option( $option, $args = array() ) { 
  2. $current_screen = get_current_screen(); 
  3.  
  4. if ( ! $current_screen ) 
  5. return; 
  6.  
  7. $current_screen->add_option( $option, $args );