User limited access
-
I’m a user on some WordPress website and they have the following functionality i’d like to replicate on my own site.
1- They have various Author Role users (me included) and each of them can add and edit their own posts, but they can’t edit or view other’s posts. I solved this modifying the functions.php file of my theme adding this to the end:
function mypo_parse_query_useronly( $wp_query ) {
if ( strpos( $_SERVER[ ‘REQUEST_URI’ ], ‘/wp-admin/edit.php’ ) !== false ) {
if ( !current_user_can( ‘level_10’ ) ) {
global $current_user;
$wp_query->set( ‘author’, $current_user->id );
}
}
}add_filter(‘parse_query’, ‘mypo_parse_query_useronly’ );
2- Every user has his own contact form (made with Contact Form 7) that they put at the end of their posts. I’ve already done this too.3- Every contact submission is stored on the site and, just like the posts, they can be seen by the respective user’s contact form.
I installed Contact Form CFDB7 for storing the Contact Form 7 submissions but i only can see them as an administrator user and not the authors. What i need is that the Contact Form 7 submissions can be seen by their respective author users.
That’s all, how can it be done?
The page I need help with: [log in to see the link]
- The topic ‘User limited access’ is closed to new replies.