WP_Screen::add_option()publicWP 3.3.0

Adds an option for the screen.

Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options.

Method of the class: WP_Screen{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Screen = new WP_Screen();
$WP_Screen->add_option( $option, $args );
$option(string) (required)
Option ID.
$args(mixed)
Option-dependent arguments.
Default: array()

Changelog

Since 3.3.0 Introduced.

WP_Screen::add_option() code WP 6.5.2

public function add_option( $option, $args = array() ) {
	$this->_options[ $option ] = $args;
}