I have a theme which automatically adds all published pages to the menu. Is there a way to override this and add some of the pages only when the user is logged in? I thought maybe there is a filter for the menu, but could not find anything that works. Note that we are talking about frontend menu and pages here and I installed the Kadence theme. Maybe some of the themes does not support this, I have no idea...
What I have already tried so far is add_filter()
with:
wp_nav_menu_items
wp_nav_menu_objects
wp_nav_menu_args
nav_menu_link_attributes
None of these filters are applied by building the menu as far as I can tell...
Looks like its the theme's default menu....
Turns out all of these work if I add a new menu to the theme. With the default menu none of them works. I'll report this as a bug to Kadence theme developers, I am curious about their opinion.