apply_filters( 'set-screen-option', mixed $screen_option, string $option, int $value )
- Since
- 2.8.0, 5.4.2
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.
Compatibility
- WordPress
- since 5.4.2
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$screen_optionmixed- The value to save instead of the option value.
Default false (to skip saving the current option). $optionstring- The option name.
$valueint- The option value.
Where this hook fires · 1
wp-admin/includes/misc.php:773set_screen_options()
Source code
* * @param mixed $screen_option The value to save instead of the option value. * Default false (to skip saving the current option). * @param string $option The option name. * @param int $value The option value. */ $screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } /** * Filters a screen option value before it is set. * * The dynamic portion of the hook name, `$option`, refers to the option name.Changelog
Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
5.4.2
Only applied to options ending with '_page', or the 'layout_columns' option.from the docblock
2.8.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.