WC_Abstract_Legacy_Order::get_order()publicWC 1.0

Deprecated from version 3.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Gets an order from the database.

Method of the class: WC_Abstract_Legacy_Order{}

No Hooks.

Return

true|false.

Usage

$WC_Abstract_Legacy_Order = new WC_Abstract_Legacy_Order();
$WC_Abstract_Legacy_Order->get_order( $id );
$id(int)
-
Default: 0)

Changelog

Deprecated since 3.0

WC_Abstract_Legacy_Order::get_order() code WC 9.0.1

public function get_order( $id = 0 ) {
	wc_deprecated_function( 'WC_Order::get_order', '3.0' );

	if ( ! $id ) {
		return false;
	}

	$result = get_post( $id );

	if ( $result ) {
		$this->populate( $result );
		return true;
	}

	return false;
}