Warning: This method has been deprecated. Logic moved to constructor instead.

WC_Abstract_Legacy_Order::init( int|object|WC_Order $order )

Load the order object. Called from the constructor.


Description Description


Parameters Parameters

$order

(Required) Order to init.


Top ↑

Source Source

File: includes/legacy/abstract-wc-legacy-order.php

	protected function init( $order ) {
		wc_deprecated_function( 'WC_Order::init', '3.0', 'Logic moved to constructor' );
		if ( is_numeric( $order ) ) {
			$this->set_id( $order );
		} elseif ( $order instanceof WC_Order ) {
			$this->set_id( absint( $order->get_id() ) );
		} elseif ( isset( $order->ID ) ) {
			$this->set_id( absint( $order->ID ) );
		}
		$this->set_object_read( false );
		$this->data_store->read( $this );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.