[wp-hackers] Can you merge two menus?

Andrew Nacin wp at andrewnacin.com
Thu Jun 16 11:26:50 UTC 2011


On Wed, Jun 15, 2011 at 3:52 PM, Peter van der Does
<peter at avirtualhome.com>wrote:

> Hi,
>
> I want to have two menus
> - Guests Menu
> - Members Menu
>
> The members menu is an exact copy of Guest plus some extra items.
>
> I know you can create two menus in admin but I would like to know
> if it's possible to create a Members menu which only holds those
> items available for members and merge these menu items with the guest
> menu when needed.


I would hook into the wp_nav_menu_objects filter and unset ones that require
login.

I wrote this once at a local meetup in response to a question, but I can't
find the code (Aaron Jorbin might have it saved somewhere). But it was a
really short plugin.

Nacin


More information about the wp-hackers mailing list