WordPress at a glance

wc_get_order() WC 1.0

Main function for returning orders, uses the WC_Order_Factory class.

No Hooks.




wc_get_order( $the_order );
Post object or post ID of the order.
Default: false

Code of wc_get_order: woocommerce/includes/wc-order-functions.php VER 3.4.6

function wc_get_order( $the_order = false ) {
	if ( ! did_action( 'woocommerce_after_register_post_type' ) ) {
		wc_doing_it_wrong( __FUNCTION__, 'wc_get_order should not be called before post types are registered (woocommerce_after_register_post_type action)', '2.5' );
		return false;
	return WC()->order_factory->get_order( $the_order );

Related Functions

From category: WooCommerce

No comments
    Hello, !     Log In . Register