Alas, still not corrected in v8.1.6…
Hi figoware,
Thank you very much for sharing.
I used your above version and tested the search, the results are the same as before: The category id field contains any number, the search box returns no results.
Any thoughts will be highly appreciated.
It’s working for me…
In the options, I have something like : “30,31,32” in the “Exclude Categories:” field.
Since I post my solution, I’d to improve the code to make it work with Custom Post Types… Here is my code :
if ( $this->wp_ver23 ) {
$excludeQuery = " AND ( ctax.term_id NOT IN ( ".$excl_list." ) OR ($wpdb->posts.post_type NOT IN ( 'post' )))";
}
else {
$excludeQuery = " AND (c.category_id NOT IN ( '.$excl_list.' ) OR ($wpdb->posts.post_type NOT IN ( 'post' )))";
}
Is that helping you ?
Thank you for your fast help. I tried the above new version. Here are the results:
I have one private group “page=bp-groups&gid=11”. I placed “11” in “Exclude Categories: 11 “. Then I searched as non-member of this private group, the content of this private group still appear in the search results. Any thoughts on this? I am new to wordpress.
This tweak also appears to be working for me. I made one additional tweak that seems to let me cover more of my bases (at least it doesn’t seem to not be working for me right now!).
Instead of swapping ‘page’ for ‘post’, I had both included in the list (and added ‘product’ to leave out select product categories). Appears to be working great so far, but I’ll test more over time.
if ( $this->wp_ver23 ) {
$excludeQuery = " AND ( ctax.term_id NOT IN ( ".$excl_list." ) OR ($wpdb->posts.post_type NOT IN ( 'post', page', 'product' )))";
}
else {
$excludeQuery = " AND (c.category_id NOT IN ( '.$excl_list.' ) OR ($wpdb->posts.post_type NOT IN ( 'post', page', 'product' )))";
}
Hi All,
Thanks for sharing. I am wondering about this:
I used Buddypress to create private group, so I only saw this private group ID: “page=bp-groups&gid=11” in URL bar. I placed “11” in “Exclude Categories: 11 “.
Then I searched as non-member of this private group, the content of this private group still appear in the search results. Is this the situation same as yours?
Thanks advance for any input.