add_screen_option( string $option, mixed $args = array() )
Register and configure an admin screen option
Parameters
- $option
-
(string) (Required) An option name.
- $args
-
(mixed) (Optional) Option-dependent arguments.
Default value: array()
Source
File: wp-admin/includes/screen.php
function add_screen_option( $option, $args = array() ) { $current_screen = get_current_screen(); if ( ! $current_screen ) { return; } $current_screen->add_option( $option, $args ); }
Expand full source code Collapse full source code View on Trac View on GitHub
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
The $option parameter define the object (input or radio button) which will be printed to the screen option section.
add_screen_option only accept 2 methods:
Example 1:
will print
Example 2:
will print
add_screen_option
not support the checkboxes method yet.Example
Change default columns for network dashboard