18 reputation
15
bio website
location
age
visits member for 2 years, 7 months
seen Oct 23 '11 at 12:39

May
27
awarded  Notable Question
Oct
8
awarded  Popular Question
Nov
30
awarded  Student
Oct
22
awarded  Scholar
Oct
22
accepted Dynamically exclude menu items from wp_nav_menu
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
Souseekah, you're the man: that worked like a charm. Thanks a lot!
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
That make sense. I'll try the new version and let you know.
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
Damn... Hahaha. Well, in my defense, I have to admit it was pretty late. But stiil...
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
That would be a good workaround in general, but in this particular case, wp_get_nav_menu_items won't retrieve the images because the img tags are not stored in the actual custom menu (only their filenames are in the description field, e.g., "image1.png"). The custom walker is what allows me to insert the img tags in the menu output.
Oct
22
revised Dynamically exclude menu items from wp_nav_menu
added 2 characters in body
Oct
22
awarded  Commentator
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
I confirmed that cond. tags don't work on filters applied to wp_nav_menu_items. This code prints the same image: function bla ($items) { $image_number = ( is_user_logged_in ) ? '2' : '1'; $items .= ( is_user_logged_in ) ? '<a href="'.wp_logout_url( $_SERVER['REQUEST_URI'] ).'"><img src="'.get_bloginfo('template_url').'/images/skin1/login_'.$image_number.'_norma‌​l.png" alt="Log Out" title="Log Out" /></a>' : '<a href="'.wp_login_url( $_SERVER['REQUEST_URI'] ).'"><img src="'.get_bloginfo('template_url').'/images/skin1/login_'.$image_number.'_norma‌​l.png" alt="Log in" title="Log in"/></a>';}
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
I updated my original post to include this for clarity.
Oct
22
revised Dynamically exclude menu items from wp_nav_menu
added 132 characters in body
Oct
22
revised Dynamically exclude menu items from wp_nav_menu
added 132 characters in body
Oct
22
comment Dynamically exclude menu items from wp_nav_menu
Hi Saq, I forgot to mention that one of the solutions that did not work was to create a custom nav_menu function and add that code as an additional argument to the function's defaults. Sadly, it did not work. I didn't try to include it in the walker, but I don't think that would work either for the same reason I mentioned above, mainly that the wp_nav_menu does not have an "exclude" argument, but I could be wrong.
Oct
21
comment Dynamically exclude menu items from wp_nav_menu
Nope, that didn't work either. I think I'm brain dead from trying to figure this out, so that might be affecting my... "performance", :-)
Oct
21
comment Dynamically exclude menu items from wp_nav_menu
Sorry about that: I had a typo in my function. I just tried $exclude = array ('4', '7'); and using the slugs too, but it is not having any effects on the walker output. I'll try the second approach and let you know.
Oct
21
comment Dynamically exclude menu items from wp_nav_menu
I tried the constuctor approach and, no matter what I try, I keep getting a "Wrong datatype for second argument" error for the in_array function. Am I doing something wrong?
Oct
21
comment Dynamically exclude menu items from wp_nav_menu
Don't worry about it!