in_widget_form

Fires at the end of the widget control form.

Description

do_action( 'in_widget_form', (array) $array ); 

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 hook is not false.

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

Parameters (1)

0. $array (array) => array( &$this, &$return, $instance )
The array.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'in_widget_form', $array ); 
The following example is for adding a hook callback.
  1. // define the in_widget_form callback 
  2. function action_in_widget_form( $array ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'in_widget_form', 'action_in_widget_form', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'in_widget_form', 'action_in_widget_form', 10, 1 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/class-wp-widget.php  
  1. do_action_ref_array( 'in_widget_form', array( &$this, &$return, $instance ) );