widget_update_callback хук-фильтр . WP 2.8.0
Filters a widget's settings before saving.
Returning false will effectively short-circuit the widget's ability to update settings.
Использование
add_filter( 'widget_update_callback', 'filter_function_name_1351', 10, 4 ); function filter_function_name_1351( $instance, $new_instance, $old_instance, $this ){ // filter... return $instance; }
- $instance(массив)
- The current widget instance's settings.
- $new_instance(массив)
- Array of new widget settings.
- $old_instance(массив)
- Array of old widget settings.
- $this(WP_Widget)
- The current widget instance.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
widget_update_callback
wp-includes/class-wp-widget.php 462
$instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );