Show only author's posts, media & comments, but Admin sees all.
-
I found a hack (see code below) that forces the user to only see their own posts and media, but the user can still see all comments.
Can someone be so kind and look at the code and advise how I can include the comments as well. Thank you for your help.NOTE: this code was added to the functions.php which resides in /wp-content/themes/twentyeleven-child/wp-admin/functions.php
—————————————
function posts_for_current_author($query) {
global $user_level;if($query->is_admin && $user_level < 5) {
global $user_ID;
$query->set(‘author’, $user_ID);
unset($user_ID);
}
unset($user_level);return $query;
}
add_filter(‘pre_get_posts’, ‘posts_for_current_author’);
—————————————————————
This hack was provided by t31os.Any assistance is much appreciated.
- The topic ‘Show only author's posts, media & comments, but Admin sees all.’ is closed to new replies.