Merge pull request #9573 from shivapoudel/shipping-class-fix
Shipping class fix
This commit is contained in:
commit
555ef9abdf
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* Setup menus in WP admin
|
||||
* Setup menus in WP admin.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 2.2.3
|
||||
* @author WooThemes
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 2.5.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_Menus' ) ) :
|
||||
|
@ -59,8 +59,6 @@ class WC_Admin_Menus {
|
|||
|
||||
add_menu_page( __( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce', null, null, '55.5' );
|
||||
|
||||
add_submenu_page( 'edit.php?post_type=product', __( 'Shipping Classes', 'woocommerce' ), __( 'Shipping Classes', 'woocommerce' ), 'manage_product_terms', 'edit-tags.php?taxonomy=product_shipping_class&post_type=product' );
|
||||
|
||||
add_submenu_page( 'edit.php?post_type=product', __( 'Attributes', 'woocommerce' ), __( 'Attributes', 'woocommerce' ), 'manage_product_terms', 'product_attributes', array( $this, 'attributes_page' ) );
|
||||
}
|
||||
|
||||
|
@ -120,15 +118,10 @@ class WC_Admin_Menus {
|
|||
break;
|
||||
case 'product' :
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( taxonomy_is_product_attribute( $screen->taxonomy ) ) {
|
||||
$submenu_file = 'product_attributes';
|
||||
$parent_file = 'edit.php?post_type=product';
|
||||
}
|
||||
|
||||
if ( 'product_shipping_class' == $screen->taxonomy ) {
|
||||
$submenu_file = 'edit-tags.php?taxonomy=product_shipping_class&post_type=product';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
*
|
||||
* Registers post types and taxonomies.
|
||||
*
|
||||
* @class WC_Post_types
|
||||
* @version 2.3.0
|
||||
* @package WooCommerce/Classes/Products
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
* @class WC_Post_types
|
||||
* @version 2.5.0
|
||||
* @package WooCommerce/Classes/Products
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -128,7 +128,7 @@ class WC_Post_types {
|
|||
);
|
||||
|
||||
register_taxonomy( 'product_shipping_class',
|
||||
apply_filters( 'woocommerce_taxonomy_objects_product_shipping_class', array('product', 'product_variation') ),
|
||||
apply_filters( 'woocommerce_taxonomy_objects_product_shipping_class', array( 'product', 'product_variation' ) ),
|
||||
apply_filters( 'woocommerce_taxonomy_args_product_shipping_class', array(
|
||||
'hierarchical' => true,
|
||||
'update_count_callback' => '_update_post_term_count',
|
||||
|
@ -146,7 +146,7 @@ class WC_Post_types {
|
|||
'add_new_item' => __( 'Add New Shipping Class', 'woocommerce' ),
|
||||
'new_item_name' => __( 'New Shipping Class Name', 'woocommerce' )
|
||||
),
|
||||
'show_ui' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_nav_menus' => false,
|
||||
'query_var' => is_admin(),
|
||||
'capabilities' => array(
|
||||
|
|
Loading…
Reference in New Issue