woocommerce_shipping_zone_method_status_toggled

woocommerce_shipping_zone_method_status_toggled

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_shipping_zone_method_status_toggled') is found 2 times:

  • /includes/class-wc-ajax.php line 3347
    					 */
    					do_action( 'woocommerce_update_non_option_setting', array( 'id' => 'zone_methods_enabled' ) );
    					$is_enabled = absint( 'yes' === $method_data['enabled'] );
    					if ( $wpdb->update( "{$wpdb->prefix}woocommerce_shipping_zone_methods", array( 'is_enabled' => $is_enabled ), array( 'instance_id' => absint( $instance_id ) ) ) ) {
    						do_action( 'woocommerce_shipping_zone_method_status_toggled', $instance_id, $method_id, $zone_id, $is_enabled );
    					}
    				}
    			}
    		}
    
    		$zone->save();
    
  • /includes/rest-api/Controllers/Version2/class-wc-rest-shipping-zone-methods-v2-controller.php line 329
     
    		// Update if this method is enabled or not.
    		if ( isset( $request['enabled'] ) ) {
    			if ( $wpdb->update( "{$wpdb->prefix}woocommerce_shipping_zone_methods", array( 'is_enabled' => $request['enabled'] ), array( 'instance_id' => absint( $instance_id ) ) ) ) {
    				do_action( 'woocommerce_shipping_zone_method_status_toggled', $instance_id, $method->id, $request['zone_id'], $request['enabled'] );
    				$method->enabled = ( true === $request['enabled'] ? 'yes' : 'no' );
    			}
    		}
    
    		return $method;
    	}