WC_Shipping_Rate::__construct( string $id = '', string $label = '', integer $cost, array $taxes = array(), string $method_id = '', int $instance_id )
Constructor.
Description Description
Parameters Parameters
- $id
-
(Optional) Shipping rate ID.
Default value: ''
- $label
-
(Optional) Shipping rate label.
Default value: ''
- $cost
-
(Required) Cost.
- $taxes
-
(Optional) Taxes applied to shipping rate.
Default value: array()
- $method_id
-
(Optional) Shipping method ID.
Default value: ''
- $instance_id
-
(Required) Shipping instance ID.
Source Source
File: includes/class-wc-shipping-rate.php
public function __construct( $id = '', $label = '', $cost = 0, $taxes = array(), $method_id = '', $instance_id = 0 ) { $this->set_id( $id ); $this->set_label( $label ); $this->set_cost( $cost ); $this->set_taxes( $taxes ); $this->set_method_id( $method_id ); $this->set_instance_id( $instance_id ); }