set-screen-option хук-фильтр . WP 2.8.0
Filters a screen option value before it is set.
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.
Использование
add_filter( 'set-screen-option', 'filter_function_name_8140', 10, 3 ); function filter_function_name_8140( $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(число)
- The option value.
Список изменений
С версии 2.8.0 | Введена. |
С версии 5.4.2 | Only applied to options ending with '_page', or the 'layout_columns' option. |
Где вызывается хук
set-screen-option
wp-admin/includes/misc.php 713
$screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores