widget_form_callback filter-hookWP 2.8.0

Filters the widget instance's settings before displaying the control form.

Returning false effectively short-circuits display of the control form.

Usage

add_filter( 'widget_form_callback', 'wp_kama_widget_form_callback_filter', 10, 2 );

/**
 * Function for `widget_form_callback` filter-hook.
 * 
 * @param array     $instance The current widget instance's settings.
 * @param WP_Widget $widget   The current widget instance.
 *
 * @return array
 */
function wp_kama_widget_form_callback_filter( $instance, $widget ){

	// filter...
	return $instance;
}
$instance(array)
The current widget instance's settings.
$widget(WP_Widget)
The current widget instance.

Changelog

Since 2.8.0 Introduced.

Where the hook is called

WP_Widget::form_callback()
widget_form_callback
WP_REST_Widget_Types_Controller::get_widget_form()
widget_form_callback
wp-includes/class-wp-widget.php 530
$instance = apply_filters( 'widget_form_callback', $instance, $this );
wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php 571-575
$instance = apply_filters(
	'widget_form_callback',
	$instance,
	$widget_object
);

Where the hook is used in WordPress

Usage not found.