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
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- 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?
- Customize Edit Post screen for Custom Post Types?
- Filter by custom field in custom post type on admin page
- Custom post type role permissions won’t let me read
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Allowing custom role access to custom post type in back end
- Merge two custom post types into one admin page?
- Remove the “View” Link in Post Admin
- Multiple custom post types under one admin menu
- How can I change the admin search posts fields?
- Restrict Contributors to view only their own custom post types?
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- Why does my custom WP role need edit_posts to edit images?
- Custom user role cannot see or modify featured image
- How to assign specific users the capability to edit specific pages / posts / custom post types
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Add “Last Edited by” column to custom post type list table
- Allow user to Edit Posts but not Add New?
- How can I filter posts by post_parent in the admin?
- Defining capabilities for custom post type
- Assign a Custom Role to a Custom Post?
- Restrict custom post type view by user role
- Filter custom post types in admin not working
- Custom post type admin search
- Creating custom user roles
- Ordering posts by custom taxonomy in admin area
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Create a dropdown with Custom Post Types as option in admin
- How to add custom columns to Custom Post Type admin screen
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Filter admin columns by custom post field value
- Is it OK to move admin menu items?
- Can I make user role that can only access a certian content type?
- Associating an “author” with a custom taxonomy
- Prevent reload confirmation after AJAX save
- Filter by custom Field for Custom post type Admin Listing
- jQuery UI in Admin (Best Practice?)
- Admin Post Update Redirection to Posts Screen
- Exclude add_filter from the admin
- Create user role restricted to specific CPT
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- Custom Post type sort order not working in the admin area
- User roles – enable custom posts disable posts
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- How to not allow custom roles to edit published custom post types?
- Custom admin columns for ALL custom post types
- How to get search results in the backend admin on a custom post type?
- Add custom column to custom post type overview in backend
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- How can I get the last posts by user role?
- 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?
- Custom user role not working as expected
- Custom post type doesn’t display on admin list
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Weird capabilities / roles behavior
- Control what custom posts a user can see
- Custom Post Type only display items created by user
- Add role privileges of the custom post type
- Prevent author role from editing others posts
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- Shared Custom post type between WP network sites
- creating different edit screens for different roles
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Custom taxonomy archive is visible to only subscibed users
- Exclude categories For Custom post types
- Admin menu post type
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- CPT, Custom User Role and problem with user manager
- Redirect preview single post link to a page
- Custom Post Type Causing Admin Sidebar UI Issue
- Custom post type media upload error with custom user role
- How to change the default orderby from “Date” to e.g. “Title” or my custom column in content type records list in admin?
- Change column of row action (Quick Edit) links in WP_List_Table
- 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
- Custom role, capabilities, and post type: preview button wrecks things
- Reservations as Post
- Prevent users from changing post status
- Custom post type & role issues
- Custom role can’t create permalink
- empty dashboard for custom role
- Read-Only custom post type
- Display read only info on admin, custom post page
- WordPress Roles
- How to set the Screen Options for Users in the Admin Panel?
- Issue displaying multiple TinyMCE editors with WPAlchemy
- Admin menu link with variable
- Need some suggestions with Relationship fields and CPT/ACF
- Frontend delete CPT post with custom role user
- How to set up a private custom post type that is accessible in the administrative dashboard?
- WordPress User Role Permissions For Custom Post Type
- Allowing a CPT post to be edited by a single user role