WC_Order_Item_Tax::offsetSet │ public │ WC 1.0 │ ReturnTypeWillChange

Deprecated since 4.4.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.

OffsetSet for ArrayAccess/Backwards compatibility.

Method of the class: WC_Order_Item_Tax{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Order_Item_Tax = new WC_Order_Item_Tax();
$WC_Order_Item_Tax->offsetSet( $offset, $value );
$offset(string) (required)
Offset.
$value(mixed) (required)
Value.

Changelog

Deprecated since 4.4.0

WC_Order_Item_Tax::offsetSet() code WC 11.1.2

public function offsetSet( $offset, $value ) {
	wc_deprecated_function( 'WC_Order_Item_Tax::offsetSet', '4.4.0', '' );
	if ( 'tax_amount' === $offset ) {
		$offset = 'tax_total';
	} elseif ( 'shipping_tax_amount' === $offset ) {
		$offset = 'shipping_tax_total';
	}
	parent::offsetSet( $offset, $value );
}