Timeline for Dynamically exclude menu items from wp_nav_menu
Current License: CC BY-SA 3.0
24 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 12:37 | history | edited | CommunityBot |
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
|
|
Dec 1, 2011 at 8:23 | history | tweeted | twitter.com/#!/StackWordPress/status/142156787439771648 | ||
Oct 22, 2011 at 17:31 | vote | accept | Marventus | ||
Oct 22, 2011 at 12:28 | comment | added | Marventus | Damn... Hahaha. Well, in my defense, I have to admit it was pretty late. But stiil... | |
Oct 22, 2011 at 11:45 | history | edited | Marventus | CC BY-SA 3.0 |
added 2 characters in body
|
Oct 22, 2011 at 5:41 | comment | added | soulseekah |
Added a wp_nav_menu_items filter method to my answer.
|
|
Oct 22, 2011 at 5:21 | comment | added | soulseekah |
You have to CALL the function is_user_logged_in() with the brackets... is it getting late there?
|
|
Oct 22, 2011 at 3:29 | comment | added | Marventus |
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.'_normal.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.'_normal.png" alt="Log in" title="Log in"/></a>';}
|
|
Oct 22, 2011 at 2:04 | history | edited | Marventus | CC BY-SA 3.0 |
added 132 characters in body
|
Oct 22, 2011 at 1:57 | history | edited | Marventus | CC BY-SA 3.0 |
added 132 characters in body
|
Oct 22, 2011 at 0:11 | answer | added | saq | timeline score: 0 | |
Oct 21, 2011 at 18:16 | comment | added | Marventus | Don't worry about it! | |
Oct 21, 2011 at 18:11 | comment | added | soulseekah | Sorry, wasn't thinking straight when I wrote that, deleted immediately. | |
Oct 21, 2011 at 18:08 | answer | added | soulseekah | timeline score: 41 | |
Oct 21, 2011 at 18:08 | comment | added | Marventus |
I thought of passing an exclude argument too, but, contrary to wp_list_pages and many other WP functions, wp_nav_menu does not include one. So even if I do specify one when calling the menu or in the walker, it wouldn't get picked up inside wp_nav_menu , would it?
|
|
Oct 21, 2011 at 18:00 | history | edited | Marventus | CC BY-SA 3.0 |
added 1 characters in body
|
Oct 21, 2011 at 17:52 | comment | added | Marventus | Hi Souleseekah, I just added it to my original post. Thanks! | |
Oct 21, 2011 at 17:48 | history | edited | Marventus | CC BY-SA 3.0 |
cleaner code
|
S Oct 21, 2011 at 17:48 | history | suggested | soulseekah | CC BY-SA 3.0 |
cleaner code
|
Oct 21, 2011 at 17:43 | review | Suggested edits | |||
S Oct 21, 2011 at 17:48 | |||||
Oct 21, 2011 at 17:42 | comment | added | soulseekah | Can you show us your custom walker child class? | |
Oct 21, 2011 at 17:33 | history | edited | Marventus | CC BY-SA 3.0 |
added 48 characters in body
|
Oct 21, 2011 at 17:19 | history | edited | Marventus | CC BY-SA 3.0 |
added 336 characters in body
|
Oct 21, 2011 at 17:14 | history | asked | Marventus | CC BY-SA 3.0 |