wphooks.info - widget_update_callback

widget_update_callback

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-wp-widget.php:
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
				 * Returning false will effectively short-circuit the widget's ability
				 * to update settings.
				 *
				 * @since 2.8.0
				 *
				 * @param array     $instance     The current widget instance's settings.
				 * @param array     $new_instance Array of new widget settings.
				 * @param array     $old_instance Array of old widget settings.
				 * @param WP_Widget $this         The current widget instance.
				 */
				$instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );
				if ( false !== $instance ) {
					$all_instances[ $number ] = $instance;
				}

				break; // run only once
			}
		}

		$this->save_settings( $all_instances );