[wp-hackers] Can you merge two menus?

Peter van der Does peter at avirtualhome.com
Thu Jun 16 13:18:09 UTC 2011


On Thu, 16 Jun 2011 07:26:50 -0400
Andrew Nacin <wp at andrewnacin.com> wrote:

> 
> 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.
> 

Apologies for changing the subject line earlier.

If you use unsetting of of menu items you still need to maintain two
menus at all times. If you add a menu item to members menu you must
also add it to the public one.

Why is it better to unset the members items as to solution I posted?


P.S. I posted the code snippet on my site as well:
http://blog.avirtualhome.com/2011/06/16/merging-wordpress-3-1-menus/


-- 
Peter van der Does

GPG key: CB317D6E

IRC: Ganseki on irc.freenode.net
Twitter: @petervanderdoes

WordPress Plugin Developer
Blog: http://blog.avirtualhome.com
Forums: http://forums.avirtualhome.com
Twitter: @avhsoftware


More information about the wp-hackers mailing list