WordPress at Your Fingertips
function is not described

WC_Shipping_Zone::delete_shipping_method() public WC 1.0

Delete a shipping method from a zone.

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

Return

True. on success, false on failure

Usage

$WC_Shipping_Zone = new WC_Shipping_Zone();
$WC_Shipping_Zone->delete_shipping_method( $instance_id );
$instance_id(int) (required)
Shipping method instance ID.

Code of WC_Shipping_Zone::delete_shipping_method() WC 5.7.0

public function delete_shipping_method( $instance_id ) {
	if ( null === $this->get_id() ) {
		return false;
	}

	// Get method details.
	$method = $this->data_store->get_method( $instance_id );

	if ( $method ) {
		$this->data_store->delete_method( $instance_id );
		do_action( 'woocommerce_shipping_zone_method_deleted', $instance_id, $method->method_id, $this->get_id() );
	}

	WC_Cache_Helper::get_transient_version( 'shipping', true );

	return true;
}