set_screen_option_(option) filter-hookWP 5.4.2

Filters a screen option value before it is set.

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

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

Usage

add_filter( 'set_screen_option_(option)', 'wp_kama_set_screen_option_filter', 10, 3 );

/**
 * Function for `set_screen_option_(option)` filter-hook.
 * 
 * @param mixed  $screen_option The value to save instead of the option value.
 * @param string $option        The option name.
 * @param int    $value         The option value.
 *
 * @return mixed
 */
function wp_kama_set_screen_option_filter( $screen_option, $option, $value ){

	// filter...
	return $screen_option;
}
$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.

Changelog

Since 5.4.2 Introduced.

Where the hook is called

set_screen_options()
set_screen_option_(option)
wp-admin/includes/misc.php 793
$value = apply_filters( "set_screen_option_{$option}", $screen_option, $option, $value );

Where the hook is used in WordPress

Usage not found.