Merge pull request #22380 from Prospress/fix/22261

register order auto drafts post status
This commit is contained in:
Mike Jolley 2019-01-16 15:11:48 +00:00 committed by GitHub
commit 1125a5d76d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 5 deletions

View File

@ -51,7 +51,8 @@ class WC_Post_Types {
'product_type',
apply_filters( 'woocommerce_taxonomy_objects_product_type', array( 'product' ) ),
apply_filters(
'woocommerce_taxonomy_args_product_type', array(
'woocommerce_taxonomy_args_product_type',
array(
'hierarchical' => false,
'show_ui' => false,
'show_in_nav_menus' => false,
@ -66,7 +67,8 @@ class WC_Post_Types {
'product_visibility',
apply_filters( 'woocommerce_taxonomy_objects_product_visibility', array( 'product', 'product_variation' ) ),
apply_filters(
'woocommerce_taxonomy_args_product_visibility', array(
'woocommerce_taxonomy_args_product_visibility',
array(
'hierarchical' => false,
'show_ui' => false,
'show_in_nav_menus' => false,
@ -81,7 +83,8 @@ class WC_Post_Types {
'product_cat',
apply_filters( 'woocommerce_taxonomy_objects_product_cat', array( 'product' ) ),
apply_filters(
'woocommerce_taxonomy_args_product_cat', array(
'woocommerce_taxonomy_args_product_cat',
array(
'hierarchical' => true,
'update_count_callback' => '_wc_term_recount',
'label' => __( 'Categories', 'woocommerce' ),
@ -120,7 +123,8 @@ class WC_Post_Types {
'product_tag',
apply_filters( 'woocommerce_taxonomy_objects_product_tag', array( 'product' ) ),
apply_filters(
'woocommerce_taxonomy_args_product_tag', array(
'woocommerce_taxonomy_args_product_tag',
array(
'hierarchical' => false,
'update_count_callback' => '_wc_term_recount',
'label' => __( 'Product tags', 'woocommerce' ),
@ -160,7 +164,8 @@ class WC_Post_Types {
'product_shipping_class',
apply_filters( 'woocommerce_taxonomy_objects_product_shipping_class', array( 'product', 'product_variation' ) ),
apply_filters(
'woocommerce_taxonomy_args_product_shipping_class', array(
'woocommerce_taxonomy_args_product_shipping_class',
array(
'hierarchical' => false,
'update_count_callback' => '_update_post_term_count',
'label' => __( 'Shipping classes', 'woocommerce' ),
@ -479,6 +484,14 @@ class WC_Post_Types {
$order_statuses = apply_filters(
'woocommerce_register_shop_order_post_statuses',
array(
'wc-auto-draft' => array(
'public' => false,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
/* translators: %s: number of orders */
'label_count' => _n_noop( 'Draft <span class="count">(%s)</span>', 'Draft <span class="count">(%s)</span>', 'woocommerce' ),
),
'wc-pending' => array(
'label' => _x( 'Pending payment', 'Order status', 'woocommerce' ),
'public' => false,