WordPress at Your Fingertips
function is not described

WC_Shipping_Zone_Data_Store::delete_method() public WC 3.0.0

Delete a method instance.

{} It's a method of the class: WC_Shipping_Zone_Data_Store{}

Return

null. Nothing.

Usage

$WC_Shipping_Zone_Data_Store = new WC_Shipping_Zone_Data_Store();
$WC_Shipping_Zone_Data_Store->delete_method( $instance_id );
$instance_id(int) (required)
Instance ID.

Changelog

Since 3.0.0 Introduced.

Code of WC_Shipping_Zone_Data_Store::delete_method() WC 5.8.0

public function delete_method( $instance_id ) {
	global $wpdb;

	$method = $this->get_method( $instance_id );

	if ( ! $method ) {
		return;
	}

	delete_option( 'woocommerce_' . $method->method_id . '_' . $instance_id . '_settings' );

	$wpdb->delete( $wpdb->prefix . 'woocommerce_shipping_zone_methods', array( 'instance_id' => $instance_id ) );

	do_action( 'woocommerce_delete_shipping_zone_method', $instance_id );
}