in_widget_form хук-событиеWP 2.8.0

Fires at the end of the widget control form.

Use this hook to add extra fields to the widget form. The hook is only fired if the value passed to the widget_form_callback is not false.

Note: If the widget has no form, the text echoed from the default form method can be hidden using CSS.

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

add_action( 'in_widget_form', 'wp_kama_in_widget_form_action', 10, 3 );

/**
 * Function for `in_widget_form` action-hook.
 * 
 * @param WP_Widget $widget   The widget instance (passed by reference).
 * @param null      $return   Return null if new fields are added.
 * @param array     $instance An array of the widget's settings.
 *
 * @return void
 */
function wp_kama_in_widget_form_action( $widget, $return, $instance ){

	// action...
}
$widget(WP_Widget)
The widget instance (passed by reference).
$return(null)
Return null if new fields are added.
$instance(массив)
An array of the widget's settings.

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

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

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

WP_Widget::form_callback()
in_widget_form
WP_REST_Widget_Types_Controller::get_widget_form()
in_widget_form
wp-includes/class-wp-widget.php 553
do_action_ref_array( 'in_widget_form', array( &$this, &$return, $instance ) );
wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php 578-581
do_action_ref_array(
	'in_widget_form',
	array( &$widget_object, &$return, $instance )
);

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

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