It is also possible for a member to see posts in a category that he doesn’t have rights by clicking “next” if he is in a post.
Would it be hard to create a fix for that?
not sure about a quick-and-dirty fix but depending on what plugins and theme(s) you’re trying to use, i would see which ones actually respect and use the suppress_filters parameter passed to the pre_get_posts hook, on which this plugin heavily relies.
for example, if a given ‘categories widget’ (not sure about the ‘built-in’ one’s behavior) sets supress_filters => false, then it will bypass the filtering that this plugin does to show/hide posts in certain categories, entirely.
Hi I have installed your plugin but unable to get it to work as per my requirements.
I am trying to hide from public view in the frontend selected categories unless a user is logged in.
In the privacy settings the required category is ticked and in the user profile the same is selected, but the category is still visable to that user and all others logged in or not my question is how do I hide the category from all users unless they are logged in?
Thanks in advance for you help.
Regards
jknurse – what wordpress theme are you using?
not all of them ‘play nice’ w/ regards to how categories/menus are rendered i.e. may or may not respect filtering to be done in WP_Query or query_posts.
Hi Kris
Thanks for your quick responds.
The theme I am using is Starkers HTML5
Would appriciate any advise thanks.
downloaded and looked at starkers’ code… don’t see anything necessarily that would affect the categories… i assume its sidebar uses the wordpress standard Categories widget? if so, then this may bring to light an inherent flaw in the Categories widget itself.
in place of the categories widget, give this a try:
<li class="widget_categories">
<h3>Categories</h3>
<ul>
<?php foreach( get_categories( ) as $cat ) {
$cat_current = ( $cat->cat_ID == $curr_cat_id ? " current-menu-item" : "" );
$cat_link = get_category_link( $cat->cat_ID );
echo '<li class="menu-item'
. $cat_current . '"><a href="'
. $cat_link . '"><span>'
. $cat->name . '</span></a></li>' . "\n";
?>
<?php } ?>
</ul>
</li>