Merge pull request #11769 from WPprodigy/nav-menus-metabox
Nav menus metabox
This commit is contained in:
commit
aa0078de8f
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue