add_screen_option

The timeline below displays how wordpress function add_screen_option has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Register and configure an admin screen option
 *
 * @since 3.1.0
 *
 * @param string $option An option name.
 * @param mixed  $args   Option-dependent arguments.
 */
function add_screen_option($option, $args = array())
{
    $current_screen = get_current_screen();
    if (!$current_screen) {
        return;
    }
    $current_screen->add_option($option, $args);
}

WordPress Version: 3.7

/**
 * Register and configure an admin screen option
 *
 * @since 3.1.0
 *
 * @param string $option An option name.
 * @param mixed $args Option-dependent arguments.
 */
function add_screen_option($option, $args = array())
{
    $current_screen = get_current_screen();
    if (!$current_screen) {
        return;
    }
    $current_screen->add_option($option, $args);
}