diff --git a/includes/admin/class-wc-admin-menus.php b/includes/admin/class-wc-admin-menus.php index 1d6a4367484..0e3dbe71248 100644 --- a/includes/admin/class-wc-admin-menus.php +++ b/includes/admin/class-wc-admin-menus.php @@ -38,6 +38,9 @@ class WC_Admin_Menus { add_filter( 'menu_order', array( $this, 'menu_order' ) ); add_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) ); + // Rename taxonomies at Appearance > Menus > Pages + add_action( 'nav_menu_meta_box_object', array( $this, 'rename_nav_menu_meta_boxes' ) ); + // Add endpoints custom URLs in Appearance > Menus > Pages add_action( 'admin_init', array( $this, 'add_nav_menu_meta_boxes' ) ); @@ -226,6 +229,19 @@ class WC_Admin_Menus { WC_Admin_Addons::output(); } + /** + * Rename taxonomies in admin menus meta boxes. + */ + public function rename_nav_menu_meta_boxes( $tax ) { + if ( 'product_cat' === $tax->name ) { + $tax->labels->name = __( 'Product Categories', 'woocommerce' ); + } elseif ( 'product_tag' === $tax->name ) { + $tax->labels->name = __( 'Product Tags', 'woocommerce' ); + } + + return $tax; + } + /** * Add custom nav meta box. *