WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Order::get_order() public WC 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.

{} It's a 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 3.0

Code of WC_Abstract_Legacy_Order::get_order() WC 5.7.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;
}