Hide Private Posts

<?php
function hide_posts($where){
if( is_admin() ) return $where;
global $wpdb;
return " $where AND {$wpdb->posts}.post_status != 'private' ";
}

add_filter('posts_where','hide_posts');
?>

0 Comments

You must be logged in to post a comment.