menus – Hide programmatically a page created by plugin
I’m building a plugin that needs to create a custom Woo page that will show a specific shortcode to its content… The page is added fine, but it also appears at the top menu. I want to hide that entry programmatically, but no matter what filter (wp_page_menu_args, wp_list_pages_excludes, and a couple more) I hooked to, it doesn’t work. Basically I’m using the stock Twenty Twenty-Two theme, which doesn’t even support a menu customizer, but I want a universal solution anyway, that will hide the page from the frontend menu, no matter what type of theme the admin will be using in their website.
Any help will be much appreciated.