Post still readable through url copy paste link
-
add_action( ‘pre_get_posts’, ‘red_show_user_posts’);
function red_show_user_posts( $query ){
if( current_user_can(‘red’) || current_user_can(‘orange’) &&
$query->is_main_query() ) if( $query->is_main_query() ) {
$query->set( ‘category__not_in’, (array(33, 32, 31, 28, 23,26)) );
} return $query;}Posts are excluded from category but still readable through direct link.
How to full exclude? Really thanks for helping me out.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Post still readable through url copy paste link’ is closed to new replies.