how to get custom admin submenu( custom post type ) item to highlight when its active

I have a menu item added using add_menu_page say ABC.

I have added a custom post_type product as a submenu item under ABC I created it with this code

add_submenu_page(
    'abc',
    'Products',
    'Products',
    'manage_options',
    'edit.php?post_type=product'
);

How to highlight submenu_page product if selected in admin menu?

1 Answer
1

Solved the above issue by putting “show_in_menu” parameter to false while registering the Custom-Post-Type product.

Leave a Comment