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:
- Load a script just to custom post type in admin
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Restrict Contributors to view only their own custom post types?
- Why does my custom WP role need edit_posts to edit images?
- Add “Last Edited by” column to custom post type list table
- Filter custom post types in admin not working
- Create a dropdown with Custom Post Types as option in admin
- Can I make user role that can only access a certian content type?
- Prevent reload confirmation after AJAX save
- jQuery UI in Admin (Best Practice?)
- Admin Post Update Redirection to Posts Screen
- Custom Post type sort order not working in the admin area
- User roles – enable custom posts disable posts
- How to not allow custom roles to edit published custom post types?
- Custom admin columns for ALL custom post types
- Add custom column to custom post type overview in backend
- Unable to filter on field on edit.php page
- How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- No results searching custom post type in admin panel
- Custom Post Type and taxonomies’s labels localization not working
- Prevent author role from editing all posts in custom post type?
- 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
- Using WPAlchemy metabox values in another metabox
- Add text to wordpress admin ‘Add Post’ edit
- Prevent authors from creating new posts of specific custom-post-type
- Registration and Custom Post Types – How to synchronize information?
- using add_role function to make some users to create a selected type post
- How can I change the title of an Add New page in Admin for custom post type
- How to customize admin posts based on the user who is logged in
- Set a default category – if the user didn’t select one- before creating a post
- Cannot attach media when capabilities added to custom post type
- How can I create a custom meta box to add an mp4 video to a page?
- After adding add_role to functions.php and creating a user, can not login into admin
- Add acf field in title (admin table)
- Role capability delete multiple post type posts doesn’t work
- How to allow a custom user role to create, edit, delete a specific custom post type only?
- Get parse_query filter to return slug instead of id
- Custom Post Type Nav to Subpage
- Selecting a post in Dashboard
- Custom admin post.php page
- Define new user capability for custom post types?
- Custom post types as sub menu pages and role capabilities issue
- Hiding posts by other users and non-logged in
- Only view/edit/delete CPT made by users with the same role
- WordPress comments_open for specific user role or post type
- Restrict Access to Posts based on Custom User and Post Meta Data
- Edit the author of custom post type
- Allow add new post access to custom post but not wp post for some role
- Allow user to only access custom post type
- Filtering posts list table
- CPT Validation to not show “Post updated.”
- Custom post type isn’t working
- disable quickedit for specific custom post type user role
- Use remove_meta_box conditionally on custom post type
- Sortable column containing numeric values for Custom Post Type at WordPress Backend
- How to check if post/page or taxonomy post is published by admin
- CPT Columns doesn’t show categories
- Role capabilities issue
- Insert Custom Post Types
- Custom Post Type – Support “author” only for admins
- Unable to edit categories in custom post type
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Prevent user from editing others posts
- Roles and Capabilities in Custom Post Types
- Is there a hook between clicking on “Add new” and the edit screen of a new post?
- Function to add custom HTML into head in custom post-type list page
- WordPress admin for a custom post, hide/collapse the main “title” and “description” boxes
- How do I “trash” a custom post type post while logged in as Admin
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Restrict Custom Post Type per role in Dashboard
- Restrict access to custom post type based on its taxonomy terms
- How can I put content before my custom post type default pages?
- While creating a post, can I restrict the authors in the dropdown list based on their user role?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Is there any filter to add a custom attribute to the tag in admin panel?
- How to only display all posts to a custom User Role?
- How to hide private posts even if user is admin
- Adding orderby url parameter to main CPT admin menu link
- How do you make a custom post type invisible for subscribers
- How can I remove “Add new” button on custom post type
- Capabilities and mapping required for a role to be able to edit other’s posts of a custom type, BUT only be able to edit their own blog posts
- Custom user roles
- Custom post type doesn’t display on admin list
- Weird capabilities / roles behavior
- Add role privileges of the custom post type
- Shared Custom post type between WP network sites
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Redirect preview single post link to a page
- Custom post type media upload error with custom user role
- Capability to read user’s own draft post of CPT
- Custom role, capabilities, and post type: preview button wrecks things
- Reservations as Post
- empty dashboard for custom role
- Display read only info on admin, custom post page