On this page
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
$instancearray-
The current widget instance's settings.
$new_instancearray-
Array of new widget settings.
$old_instancearray-
Array of old widget settings.
$widgetWP_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 );
Related
Used By
| Used By | Description |
|---|---|
| WP_REST_Widget_Types_Controller::encode_form_data() wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | An RPC-style endpoint which can be used by clients to turn user input in a widget admin form into an encoded instance object. |
| WP_Widget::update_callback() wp-includes/class-wp-widget.php | Handles changed settings (Do NOT override). |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/widget_update_callback