From b3198d254696391690e62953c1f0df2b55eb8439 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 28 Mar 2017 12:37:17 +0100 Subject: [PATCH] woocommerce_after_register_post_type action --- includes/class-wc-post-types.php | 2 ++ includes/wc-order-functions.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-post-types.php b/includes/class-wc-post-types.php index f951954d956..fae40c0ec40 100644 --- a/includes/class-wc-post-types.php +++ b/includes/class-wc-post-types.php @@ -449,6 +449,8 @@ class WC_Post_types { ) ) ); + + do_action( 'woocommerce_after_register_post_type' ); } /** diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index b54cf34a8a4..9f248f8091a 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -93,8 +93,8 @@ function wc_get_orders( $args ) { * @return WC_Order|WC_Refund */ function wc_get_order( $the_order = false ) { - if ( ! did_action( 'woocommerce_register_post_type' ) ) { - wc_doing_it_wrong( __FUNCTION__, __( 'wc_get_order should not be called before post types are registered (woocommerce_register_post_type action).', 'woocommerce' ), '2.5' ); + 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).', 'woocommerce' ), '2.5' ); return false; } return WC()->order_factory->get_order( $the_order );