woocommerce_after_register_post_type action

This commit is contained in:
Mike Jolley 2017-03-28 12:37:17 +01:00
parent f50254be28
commit b3198d2546
2 changed files with 4 additions and 2 deletions

View File

@ -449,6 +449,8 @@ class WC_Post_types {
)
)
);
do_action( 'woocommerce_after_register_post_type' );
}
/**

View File

@ -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 );