Unfortunately it’s not yet working. I added the class “hide-if-logged-out” to the appropriate menus (required adjusting the screen settings on sliding panel at the top of wp-admin/nav-menus.php) and added this to my CSS:
.logged-out .hide-if-logged-out {
display: none;
visibility: hidden;
}
HTML of the page shows that the class “logged-out” is not displayed anywhere on the page. On pages where the user is logged in, the <body> element is given the class “logged-in”. I tried changing the above code to
body:not(.logged-in) .hide-if-logged-out {
display: none;
visibility: hidden;
}
but ran into the fact that this CSS3 feature is not supported by IE8 and earlier. Is there another way to have this CSS be activated on pages that aren’t served for logged-in users?
Of course a PHP solution would be to best, to not output any HTML and CSS at all. I propose the following addition to BAW Login/Logout Menu:
Add this dropdown list next to all menu links on wp-admin/nav-menus.php: Display to: [All users]
where the other options are Logged-in users, Non-logged-in users, and then each user role (to allow links that are only for Administrators). This would be very useful. I’ve already thought of more advanced solutions to allow for comma-separated lists of roles (eg. Administrators,Editors) that can have the roles displayed below as a help-text and/or use the same autofill as the tag selection on Edit Post page. That might take a bit longer to implement, though, and right now I’d love the first solution, to just be able to show any links only for either Logged-in users or Non-logged-in users.