This goes beyond posts and media. I have several CPT’s and a calendar. Is there a way to have wordpress check the user name and only show content they have created?
Leave a Reply
You must be logged in to post a comment.
This goes beyond posts and media. I have several CPT’s and a calendar. Is there a way to have wordpress check the user name and only show content they have created?
You must be logged in to post a comment.
In the backend, to filter all post types that are shown and restrict the visualization you can use
pre_get_posts
.After applying this code, you’ll notice that the post count is not correct: it’ll show the total count and not the user count. To adjust that, refer to this Q&A: Update post counts (published, draft, unattached) in admin interface.
You’ll need to care about user roles and capabilities as well, blocking the rights to edit someone else’s posts/pages/cpts. That’s because a user can type in the browser address
example.com/wp-admin/post.php?post=POST_ID&action=edit
and access the post, if he/she has the rights to do so.you can try adding this to the loop
I use the members plugin to create a custom-defined role for users.
http://wordpress.org/extend/plugins/members/