widget_update_callback WordPress Filter Hook

The widget_update_callback hook is triggered when a widget is updated. It allows you to perform custom actions when a widget is updated, such as saving extra settings or displaying a confirmation message.

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.


Top ↑

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.


Top ↑

Source

File: wp-includes/class-wp-widget.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.