Merge pull request #11769 from WPprodigy/nav-menus-metabox

Nav menus metabox
This commit is contained in:
Mike Jolley 2016-08-25 10:47:40 +01:00 committed by GitHub
commit aa0078de8f
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( 'menu_order', array( $this, 'menu_order' ) );
add_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) ); add_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) );
// Rename taxonomies at Appearance > Menus > Pages
add_filter( 'nav_menu_meta_box_object', array( $this, 'rename_nav_menu_meta_boxes' ) );
// Add endpoints custom URLs in Appearance > Menus > Pages // Add endpoints custom URLs in Appearance > Menus > Pages
add_action( 'admin_init', array( $this, 'add_nav_menu_meta_boxes' ) ); add_action( 'admin_init', array( $this, 'add_nav_menu_meta_boxes' ) );
@ -226,6 +229,19 @@ class WC_Admin_Menus {
WC_Admin_Addons::output(); 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. * Add custom nav meta box.
* *