woocommerce_widget_field_<type>

The WooCommerce woocommerce widget field type hook.

Description

do_action( 'woocommerce_widget_field_<type>', (unknown) $key, (unknown) $value, (unknown) $setting, (unknown) $instance ); 

Parameters (4)

0. $key (unknown)
The key.
1. $value (unknown)
The value.
2. $setting (unknown)
The setting.
3. $instance (unknown)
The instance.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'woocommerce_widget_field_{$type}', $key, $value, $setting, $instance ); 
The following example is for adding a hook callback.
  1. // define the woocommerce_widget_field_<type> callback 
  2. function action_woocommerce_widget_field_type( $key, $value, $setting, $instance ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "woocommerce_widget_field_{$type}", 'action_woocommerce_widget_field_type', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "woocommerce_widget_field_{$type}", 'action_woocommerce_widget_field_type', 10, 4 ); 

Defined (1)

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

/includes/abstracts/abstract-wc-widget.php  
  1. do_action( 'woocommerce_widget_field_' . $setting['type'], $key, $value, $setting, $instance );