Rename taxonomies at Appearance > Menus > Pages

This commit is contained in:
Caleb Burks 2016-08-24 18:22:47 -05:00
parent d4d1a95f21
commit dc876749cc
1 changed files with 16 additions and 0 deletions

View File

@ -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.
*