jackjermey
Member
Posted 2 years ago #
Is there a way to allow contributors to see only their own post and edit while disallowing them to do anything else?
I've been looking around for a solution but the closest one is http://www.kpdesign.net/wp-plugins/wp-hide-dashboard provided but it is not what I'm looking for.
I want contributiors to view their post only (by default they can view all posts by other authors as well) and edit their own profile.
Any solution?
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');
put this in functions.php
patter38
Member
Posted 2 years ago #
I tried this and it just gave blank pages. I'll keep looking...