I don’t think you should try to do anything here.
The top-level menu has 5 sub-menu pages (Settings, Getting Started, Authentication, Shortcode Replacement, and Helpers).
- If your user does not have admin privileges, Photonic will automatically remove the “Settings” and “Authentication” pages.
- If your user has the capability to edit posts, they must see the other menu pages (“Getting Started”, “Shortcode Replacement” and “Helpers”).
- If your user is just a regular subscriber and does not have any capability to edit anything on your site, Photonic will automatically remove all menu items.
Hello Support,
No. 2 match with my requirement.
But I want to hide photonic in second case.
How can I do that?
I don’t understand why you want to remove a help page that does not have any settings.
Anyway, your code is correct. You just need to place it in the correct hook. Make sure you go through WP documentation for it (https://developer.wordpress.org/reference/functions/remove_menu_page/)