Yes this is possible. Add the following to either your plugin code or the theme’s functions.php file:
function mypo_parse_query_useronly( $wp_query ) {
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
if ( !current_user_can( 'update_core' ) ) {
global $current_user;
$wp_query->set( 'author', $current_user->id );
}
}
}
add_filter('parse_query', 'mypo_parse_query_useronly' );
Reference original source here
This will limit the posts displayed to the each author’s own posts only.
Related Posts:
- Allow member to have access to custom post type only. Permission to only edit their own posts
- Load a script just to custom post type in admin
- Allowing custom role access to custom post type in back end
- Why does my custom WP role need edit_posts to edit images?
- Defining capabilities for custom post type
- Assign a Custom Role to a Custom Post?
- Creating custom user roles
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Can I make user role that can only access a certian content type?
- jQuery UI in Admin (Best Practice?)
- Exclude add_filter from the admin
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- User roles – enable custom posts disable posts
- Custom admin columns for ALL custom post types
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- Custom user role not working as expected
- Adding help information to custom post edit page
- Custom Post Type and taxonomies’s labels localization not working
- How can I add a column in the wp_list_table of the admin area?
- Show admin help message across custom post type parent and child posts
- How to show custom (checkbox) field value in admin post list?
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Custom Role can’t trash Custom Post Type
- Limit access to page depending on user level
- Custom post admin filtering by post meta (the date)
- Why does current_user_can(‘edit_posts’) return true, but current_user_can(‘edit_post’, $post->ID) returns false?
- Admin Column Text Positioning
- How to publish custom post type for custom role user and not “submit for review”?
- Registration and Custom Post Types – How to synchronize information?
- Limit users by custom taxonomy and user roles
- Allow Administrator role access to custom capabilities [duplicate]
- How to enable a custom post type to custom user role in WordPress
- How to only show posts assigned to current user, only in certain post types
- How to restrict CPT post’s fronted view only for specific user roles?
- Adding HTML tags or css classes to admin columns
- Create a page that will be used to create a custom post type
- A simple script to allow sorting of custom posts in admin?
- Custom post types as sub menu pages and role capabilities issue
- Hiding posts by other users and non-logged in
- I want to create custom post in which user can share files like PDF & DOCx
- WooCommerce Customer Role Delete Custom Post Type
- Options page – dropdown of users
- No Permission to add new Page, Post or CPT with Admin role
- Disable user from updating certain posts
- Access to CPT but not to ‘post’ post type
- Deny user access to edit post while allow him to edit custom post type
- Allow user to only access custom post type
- Filtering posts list table
- Want to be able to sign up subscribers as authors
- Custom post type isn’t working
- Add a ‘guide’ image to custom post type admin page
- disable quickedit for specific custom post type user role
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- Sortable column containing numeric values for Custom Post Type at WordPress Backend
- how to associate several authors to a custom post type
- Linking to Post Types from wp-admin
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- sortable columns for multiple custom post types not working
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Select other roles as custom post authors
- Unable to edit categories in custom post type
- Filter posts of custom post type by meta key in (List All Section)
- Preventing role reading others posts
- Enable comments for post when comments meta box removed
- Roles and Capabilities in Custom Post Types
- Is there a hook between clicking on “Add new” and the edit screen of a new post?
- Require custom post type if is_admin() – template doesn’t show up?
- using the loop in custom meta is messing up ‘add new’ post type
- WordPress admin for a custom post, hide/collapse the main “title” and “description” boxes
- Change user role when user’s first post gets published
- While creating a post, can I restrict the authors in the dropdown list based on their user role?
- Clone wp-admin/users.php (Users Admin Page)
- Added new role with custom capability. But cannot access the page
- Conditional editing CPT – using editor’s role and author’s usermeta
- Remove plugin settings from post creation page for a user role
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- Front-end submitted post is published with admin ID as author
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- Front End users account with lots of user Roles (not Woocommerce)
- Create an administation subpage containing posts in a certain category
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Custom Post Type only display items created by user
- Add role privileges of the custom post type
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- creating different edit screens for different roles
- Exclude categories For Custom post types
- CPT, Custom User Role and problem with user manager
- Custom post type media upload error with custom user role
- Collection of fields in a single post
- Display and Allow users to edit their own profiles
- Custom Post Type supports author
- Capability to read user’s own draft post of CPT
- Reservations as Post
- Custom post type & role issues
- Custom role can’t create permalink
- Read-Only custom post type
- Display read only info on admin, custom post page
- WordPress Roles
- How to set up a private custom post type that is accessible in the administrative dashboard?
- WordPress User Role Permissions For Custom Post Type