You can’t. The plugin just isn’t set up for that. Best case would be to create 2 menu items for “Post a Job”: the first, only shown to logged out users and the second show to Candidates.
ah i didn’t even think of that. very logical 🙂 thank you!
It isn’t really ideal, but yours seems a special use case and I’m probably not updating the plugin to change how it works any time soon.
I have a similar case.
Where I have a WooCommerce store and I’d like to show a link for Join for those users that don’t have an active Subscription, but also those that aren’t logged in as well.
I’m open to suggestions. I just don’t want to have all checkboxes because then people could easily check ‘all logged in’ and ‘all logged out’ and it would be a mess.
That I totally get for sure.
I’m totally shooting off the top of my head right now, but maybe if ‘By Role’ is selected then there are radio buttons for Logged In/Logged Out/Both and then you have the roles listed as checkboxes?
What about adding “Logged Out” as a pseudo “role” and giving it a checkbox?
http://i.imgur.com/M686iYe.png
I don’t know how that would play with the back-end code however. As a friendly reminder that this code is on Github and I am open to contributions.
I think that may work — I had forked it and working on a solution that seems to work well.
Send me a pull request if you come up with something good.
It turns out that this is already possible using the current filters available in NMR. Modified from the FAQ and taking into account @codewaggle’s correction to the FAQ (to be published soon) here is my suggestion:
function kia_new_roles( $roles ){
$roles['logged-out'] = 'All Logged Out';
return $roles;
}
add_filter( 'nav_menu_roles', 'kia_new_roles' );
function kia_item_visibility( $visible, $item ){
if( isset( $item->roles ) && is_array( $item->roles ) && in_array( 'logged-out', $item->roles ) && ! is_user_logged_in() ){
$visible = true;
}
return $visible;
}
add_filter( 'nav_menu_roles_item_visibility', 'kia_item_visibility', 10, 2 );
I make no guarantees and can’t really work on it further. It seems to work for me, but hasn’t been extensively tested either.