woocommerce_shipping_zone_method_status_toggled

The WooCommerce woocommerce shipping zone method status toggled hook.

Description

do_action( 'woocommerce_shipping_zone_method_status_toggled', (unknown) $instance_id, (unknown) $method_id, (unknown) $zone_id, (unknown) $is_enabled ); 

Parameters (4)

0. $instance_id (unknown)
The instance id.
1. $method_id (unknown)
The method id.
2. $zone_id (unknown)
The zone id.
3. $is_enabled (unknown)
The is enabled.

Usage

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

Defined (2)

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

/includes/class-wc-ajax.php  
  1. do_action( 'woocommerce_shipping_zone_method_status_toggled', $instance_id, $method_id, $zone_id, $is_enabled ); 
/includes/api/class-wc-rest-shipping-zone-methods-controller.php  
  1. do_action( 'woocommerce_shipping_zone_method_status_toggled', $instance_id, $method->id, $request['zone_id'], $request['enabled'] );