To add a role see:
https://codex.wordpress.org/Function_Reference/add_role
To add capabilities see:
click add_cap link on the bottom
A list of all caps see:
https://codex.wordpress.org/Roles_and_Capabilities
For all the roles you can also use them for different post types.
if post type is “books”
edit_pages -> edit_books.
N.B.: This setting is saved to the database (in table wp_options, field wp_user_roles), so it might be better to run this on theme/plugin activation
Related Posts:
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- Associating an “author” with a custom taxonomy
- How to not allow custom roles to edit published custom post types?
- Define new user capability for custom post types?
- How do I “trash” a custom post type post while logged in as Admin
- Remove plugin settings from post creation page for a user role
- Custom page for creating/editing custom post type
- Add role privileges of the custom post type
- creating different edit screens for different roles
- empty dashboard for custom role
- How to allow a custom user role to create, edit, delete a specific custom post type only?
- Display content based on a users login
- How to Mass Delete Images from Media Library
- Customize the Dashboard Menu Editor
- map_meta_cap woes
- Roles for Custom Post Types
- Permalink structure by Post Meta value
- Role scoping for contributors down to the field level
- How to integrate video slide using custom post types?
- can’t see custom post content filtered under “mine” filter in admin panel
- filter custom post type by meta key in dashboard
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- How to allow visitors to enter custom post type?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- Custom post types as sub menu pages and role capabilities issue
- Hiding posts by other users and non-logged in
- 2 Templates 1 custom post type according url
- WordPress multiple custom post types capability conflict in a single menu
- How do I move/order posts with a tag to the end?
- changing meta value and meta key of price field
- Team club with CPTs and user registration + user dashboard
- WordPress sort search results by custom order
- Only view/edit/delete CPT made by users with the same role
- Cluster CPT posts to users based on ACF value from their profile on dashboard
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to set individual capability of post type in individual category
- 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?
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- I want to create custom post in which user can share files like PDF & DOCx
- Time based access control of custom post types – what is good approach?
- Show titles, date of all posts on single category page
- WooCommerce Customer Role Delete Custom Post Type
- delete_published_posts does not work
- How to start a new post with custom Taxonomies already set?
- WooCommerce sort products by the actual product width(not the shipping width)
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- How to handle paged param in post and custom-post-type?
- Default text in a specific post type, but not visible?
- Update postmeta Parent when post_status child change
- Allow Contributor to edit but not update a published post
- WP_Query custom post type query not showing the exact post type
- Users create/join groups
- Shortcode to display Staff post type based on Location post type and Specialty post type
- Disable user from updating certain posts
- Edit the author of custom post type
- “Submit for review” for updates on existing posts
- Access to CPT but not to ‘post’ post type
- How to remove post listing page for a custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- Allow add new post access to custom post but not wp post for some role
- Deny user access to edit post while allow him to edit custom post type
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- A form that can save/edit after first input
- Adding the_content() in custom template email
- Cannot save CPT meta box
- non-hierarchical post type with hierarchical url structure
- Create custom post with custom user rules
- Send notification to the admin when new custom post is submitted
- Allow user to only access custom post type
- How do i search authors from search form using author’s name
- Allow users to create posts without logging in?
- How to add attributes to taxonomies that may be different from post to post?
- Pages are not saving due to custom post type
- How to show featured image block in custom post type for Author?
- Migrating a taxonomy’s tags to the native category
- How to produce a sub-page-system in WordPress
- Want to be able to sign up subscribers as authors
- Best structure / rewrite rules to achieve the following url
- don’t publish custom post type post if a meta data field isn’t valid
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- How to sort posts in a custom post type by title in ascending order by default?
- Categorise Custom Post Types
- Detect inside a custom query the kind of post type to assign custom classes
- custom post type vs. conditionally displaying meta boxes for specific terms?
- Edit the_content() function so to add a div wrapper
- How do you make a custom post type items automatically delete items 3 months after publication?
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Number of posts in the archive
- custom post data – how to
- Ordering Submenu Pages in WP 3.1
- 404 Error on form submission within custom post type