[wp-hackers] Can you merge two menus?

Doug Stewart zamoose at gmail.com
Wed Jun 15 20:19:41 UTC 2011


On Wed, Jun 15, 2011 at 4:13 PM, Peter van der Does
<peter at avirtualhome.com> wrote:
> On Wed, 15 Jun 2011 16:09:09 -0400
> Michael Van Winkle <mike at mikevanwinkle.com> wrote:
>
>> I've always done this either with two separate menus and a
>> conditional statement in the theme file.  Why do they need to be
>> "merged"?
>>
>
> Because it's easier in maintenance of the menu. When you add a General
> item, no need to worry you might forget to add them to other menus.


Use wp_get_nav_menu_items()[1] and then do an array_merge()[2], perhaps?

[1] http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items
[2] http://us.php.net/array_merge
-- 
-Doug
@zamoose
http://literalbarrage.org/blog/


More information about the wp-hackers mailing list