You can try post_row_actions hook:
/**
* Hide quick edit
*
* @internal Used as a callback.
*
* @see https://developer.wordpress.org/reference/hooks/post_row_actions/
*/
function wpse288663_hide_quick_edit($actions, $post)
{
// Replace `{$cap}` with your specific capability.
if (CPT_SLUG === $post->post_type && current_user_can({$cap})) {
unset($actions['inline hide-if-no-js']);
}
return $actions;
}
// Hook up.
add_filter('post_row_actions', 'wpse288663_hide_quick_edit', 10, 2);
Related Posts:
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- Custom post type role permissions won’t let me read
- Restrict Contributors to view only their own custom post types?
- Why does my custom WP role need edit_posts to edit images?
- Custom user role cannot see or modify featured image
- Quick edit screen customization
- How to assign specific users the capability to edit specific pages / posts / custom post types
- Allow user to Edit Posts but not Add New?
- Restrict custom post type view by user role
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Associating an “author” with a custom taxonomy
- Remove quick edit for custom post type
- Create user role restricted to specific CPT
- User roles – enable custom posts disable posts
- How to not allow custom roles to edit published custom post types?
- How can I get the last posts by user role?
- 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?
- Which User Role for Custom Post Type Menu – wp_nav
- Adding capabilities to default roles
- grant a privilege for roles (for example editors) and higher
- Prevent author role from editing all posts in custom post type?
- 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
- Role Capabilities: Add New Ones?
- Prevent authors from creating new posts of specific custom-post-type
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Registration and Custom Post Types – How to synchronize information?
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- Add custom capabilities to existing custom post type
- allow edit of custom post type but not regular posts?
- using add_role function to make some users to create a selected type post
- Why is my Custom Post Type not showing up after adding capabilities?
- Cannot attach media when capabilities added to custom post type
- After adding add_role to functions.php and creating a user, can not login into admin
- Restrict user to only one custom post type
- only a certain role has access to a cpt
- current_user_can() return FALSE but debugging says TRUE
- 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?
- map_meta_cap woes
- Roles for Custom Post Types
- Role scoping for contributors down to the field level
- can’t see custom post content filtered under “mine” filter in admin panel
- Is there a way to enable bulk edit and quick edit on custom post types?
- Define new user capability for custom post types?
- WordPress multiple custom post types capability conflict in a single menu
- Only view/edit/delete CPT made by users with the same role
- Rows with custom columns not well formatted after Quick Edit save
- WordPress comments_open for specific user role or post type
- Restrict Access to Posts based on Custom User and Post Meta Data
- Giving permission to anyone (non-users as well) with a password to edit a post, possible?
- Allow Contributor to edit but not update a published post
- Users create/join groups
- Custom title set on quick edit
- Edit the author of custom post type
- “Submit for review” for updates on existing posts
- Allow add new post access to custom post but not wp post for some role
- Create custom post with custom user rules
- Allow user to only access custom post type
- How to show featured image block in custom post type for Author?
- WordPress custom post type capabilities issue
- Custom User role not working with custom post type
- how to associate several authors to a custom post type
- Building Forums with Custom Post Types
- 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
- Enable comments for post when comments meta box removed
- Change user role when user’s first post gets published
- Restrict access to custom post type based on its taxonomy terms
- Clone wp-admin/users.php (Users Admin Page)
- Why “Mine” is the default view when adding ‘capability_type’ in register_post_type
- Added new role with custom capability. But cannot access the page
- Create relationship between custom post types and users
- Restrict admin pages for specific user role
- Custom Column in CPT admin table not updated after Quick Edit save
- Conditional editing CPT – using editor’s role and author’s usermeta
- How to only display all posts to a custom User Role?
- 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
- I want to show post details based on roles user login
- Multiple useres editing specified content
- Instructor can view, edit, delete only theirs courses
- Front End users account with lots of user Roles (not Woocommerce)
- Capibilities of CPT WordPress
- Editor role isn’t seeing specific post type posts with only post_type parameter
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Control what custom posts a user can see
- Custom Post Type only display items created by user
- Prevent author role from editing others posts
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Custom taxonomy archive is visible to only subscibed users
- CPT, Custom User Role and problem with user manager
- Display and Allow users to edit their own profiles
- Custom role, capabilities, and post type: preview button wrecks things
- Custom role can’t create permalink
- Read-Only custom post type
- Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?
- Need some suggestions with Relationship fields and CPT/ACF
- WordPress User Role Permissions For Custom Post Type
- Allowing a CPT post to be edited by a single user role