[wp-hackers] hide specific nav items from public users

Ryann Micua ryannmicua at gmail.com
Wed Jun 27 13:20:34 UTC 2012

Hi, can you guys help me with this thing I want to do?

So I created this metabox for pages. This metabox has a checkbox "Show 
to logged in users only". If it's checked, this page should be seen only 
by logged in users.

I then added this page to the main menu using wp's menu editor.

I can handle the checks in the page template. What I'd like to do though 
is to be able to "hide" the page from the main nav if the user is not 
logged in - even if I added it to the main menu.

I could probably hunt for the right filter somewhere but I figured it'd 
be faster to ask for help from the gurus :) Is there like a filter 
similar to the "the_posts" filter which gives an array of post objects 
queried from the database? I sometimes use this filter to hide posts 
from non-logged in users, so I was hoping there'd be a similar filter in 
place for nav items which would be useful for modifying the items just 
before they're displayed..

Thanks so much for your help!

*Ryann Micua*
/Web Developer/

Website: /www.pogidude.com/
Skype: /rmicua/
Mobile: /+639169273059/

More information about the wp-hackers mailing list