widget_form_callback хук-фильтрWP 2.8.0

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

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

Использование

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(массив)
The current widget instance's settings.
$widget(WP_Widget)
The current widget instance.

Список изменений

С версии 2.8.0 Введена.

Где вызывается хук

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 568-572
$instance = apply_filters(
	'widget_form_callback',
	$instance,
	$widget_object
);

Где используется хук в WordPress

Использование не найдено.