WordPress at Your Fingertips
function is not described

WC_Order_Item_Meta::__construct() public WC 1.0

Constructor.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item_Meta = new WC_Order_Item_Meta();
$WC_Order_Item_Meta->__construct( $item, $product );
$item(array)
defaults to array().
Default: array()
$product(\WC_Product)
defaults to null.
Default: null

Code of WC_Order_Item_Meta::__construct() WC 5.6.0

public function __construct( $item = array(), $product = null ) {
	wc_deprecated_function( 'WC_Order_Item_Meta::__construct', '3.1', 'WC_Order_Item_Product' );

	// Backwards (pre 2.4) compatibility.
	if ( ! isset( $item['item_meta'] ) ) {
		$this->legacy = true;
		$this->meta   = array_filter( (array) $item );
		return;
	}
	$this->item    = $item;
	$this->meta    = array_filter( (array) $item['item_meta'] );
	$this->product = $product;
}