On this page
WP_Screen::add_option( string $option, mixed $args = array() )
Adds an option for the screen.
Description
Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options.
Parameters
$optionstring Required-
Option ID.
$argsmixed Optional-
Option-dependent arguments.
Default:
array()
Source
File: wp-admin/includes/class-wp-screen.php. View all references
public function add_option( $option, $args = array() ) {
$this->_options[ $option ] = $args;
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Screen::render_screen_meta() wp-admin/includes/class-wp-screen.php | Renders the screen’s help section. |
Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_screen/add_option