widget_update_callback
Filters a widget's settings before saving.
Description
Parameters (3)
- 0. $array
- The array.
- 1. $int (int) =>
10
- The int.
- 2. $int (int) =>
3
- The int.
Usage
- To run the hook, copy the example below.
- $array = apply_filters( 'widget_update_callback', $array, $int, $int );
- if ( !empty( $array ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the widget_update_callback callback
- function filter_widget_update_callback( $array, $int, $int ) {
- // make filter magic happen here...
- return $array;
- };
- // add the filter
- add_filter( 'widget_update_callback', 'filter_widget_update_callback', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'widget_update_callback', 'filter_widget_update_callback', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /modules/widget-visibility/widget-conditions.php
- add_filter( 'widget_update_callback', array( __CLASS__, 'widget_update' ), 10, 3 );