apply_filters( 'widget_update_callback', array $instance , array $new_instance , array $old_instance , WP_Widget $widget )
Filters a widget’s settings before saving.
Description
Returning false will effectively short-circuit the widget’s ability to update settings.
Parameters
-
$instance
array -
The current widget instance's settings.
-
$new_instance
array -
Array of new widget settings.
-
$old_instance
array -
Array of old widget settings.
-
$widget
WP_Widget -
The current widget instance.
Source
File: wp-includes/class-wp-widget.php
.
View all references
$instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
You may filter any field that already registered. For testing, Firstly we create a custom widget field end of the each widgets control form.
Now, we filter widget’s settings before saving. It will save our custom field
column
data.