WC_Admin_Menus::menu_highlight
Highlights the correct top level admin menu item for post type add screens.
Method of the class: WC_Admin_Menus{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Admin_Menus = new WC_Admin_Menus(); $WC_Admin_Menus->menu_highlight();
WC_Admin_Menus::menu_highlight() WC Admin Menus::menu highlight code WC 10.6.2
public function menu_highlight() {
global $parent_file, $submenu_file, $post_type;
switch ( $post_type ) {
case 'shop_order':
case 'shop_coupon':
$parent_file = 'woocommerce'; // WPCS: override ok.
break;
case 'product':
$screen = get_current_screen();
if ( $screen && taxonomy_is_product_attribute( $screen->taxonomy ) ) {
$submenu_file = 'product_attributes'; // WPCS: override ok.
$parent_file = 'edit.php?post_type=product'; // WPCS: override ok.
}
break;
}
}