After discovering some of the imaginative and wondrous ways 🙂 in which the new WP custom menus were being used, a recursive layer was added to preserve the integrity of the menu system while preventing 404 Page Not Found errors.

Essentially, if a hierarchical menu item points to a categoryor page for which the current user has no permissions but said menu item has “children” for which the current viewer does have permissions, the protected menu item is converted to a custom menu item without destination (meaning visible but not clickable), thus preserving the cascading menu structure.

If a “parent” is protected and not viewable by the current user and the same is true of all children in that particular tree, the tree (or nodes within a tree) is removed entirely.

It’s a mouthful, I know… Sorry…

Scroll to Top