set_screen_option_(option) хук-фильтрWP 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.

Использование

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(разное)
The value to save instead of the option value.
По умолчанию: false (to skip saving the current option)
$option(строка)
The option name.
$value(int)
The option value.

Список изменений

С версии 5.4.2 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.