set-screen-option WordPress Filter Hook
The set-screen-option hook is a hook that is used to set the value of an option for a particular screen. The hook takes two arguments: the option name and the option value.
apply_filters( 'set-screen-option', mixed $screen_option , string $option , int $value ) #
Filters a screen option value before it is set.
Description
The filter can also be used to modify non-standard [items]_per_page settings. See the parent function for a full list of standard options.
Returning false from the filter will skip saving the current option.
See also
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.
Source
Changelog
Version | Description |
---|---|
5.4.2 | Only applied to options ending with '_page', or the 'layout_columns' option. |
2.8.0 | Introduced. |