set_screen_option_{$option} WordPress Filter Hook

The set_screen_option_{$option} hook is used to set the value for a given option on the current screen. The option must be registered with the add_screen_option() function. The hook takes two arguments: the new value for the option and the old value for the option. If the new value is different from the old value, the option will be updated.

apply_filters( "set_screen_option_{$option}", mixed $screen_option, string $option, int $value ) #

Filters a screen option value before it is set.


Description

The dynamic portion of the hook name, $option, refers to the option name.

Returning false from the filter will skip saving the current option.

Top ↑

See also


Top ↑

Parameters

$screen_option

(mixed)The value to save instead of the option value. Default false (to skip saving the current option).

$option

(string)The option name.

$value

(int)The option value.


Top ↑

Source

File: wp-admin/includes/misc.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.4.2Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.