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
- Custom post type role permissions won’t let me read
- Why are the comments disabled by default on my custom_post_types?
- Linking Two Post Types
- Adding Custom Post Type Counts to the Dashboard
- Custom user role cannot see or modify featured image
- Custom Post Types on Category Pages
- Allow user to Edit Posts but not Add New?
- Restrict custom post type view by user role
- How do I filter the excerpt metabox description in admin?
- Setting up custom post type archives in WP3.1? Any luck?
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Best Way to Create a List of Musician Gigs in WordPress
- TV Show database – Best way for structuring it?
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- How to add a select menu to this metabox code?
- Query posts by custom post type and custom taxonomy
- How can I get the last posts by user role?
- Adding capabilities to default roles
- Get the post children count of a post
- Role Capabilities: Add New Ones?
- Should I use Custom Post Types or something else
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- Custom post type capabilities require “create_posts” to access the edit posts list page
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Add custom capabilities to existing custom post type
- allow edit of custom post type but not regular posts?
- How to redirect wp-admin/index.php to a custom post type?
- Show Two custom Post type and their posts on category page
- Custom post type and body_class: Remove “blog” class
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Why is my Custom Post Type not showing up after adding capabilities?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- only a certain role has access to a cpt
- How to Mass Delete Images from Media Library
- 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
- List custom taxonomy specific to one custom post type
- 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
- delete_published_posts does not work
- Users create/join groups
- “Submit for review” for updates on existing posts
- Want to be able to sign up subscribers as authors
- Best structure / rewrite rules to achieve the following url
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- 404 Error on form submission within custom post type
- Remove Quick edit for custom post type?
- how to associate several authors to a custom post type
- List Categories (wp_terms) and count posts
- Displaying multiple post types on home page
- Conflict between wp_list_pages and get_posts – list pages not displaying
- 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
- List All Custom Post Types Posts in Nav Menu Dynamically
- How to export custom post type with ACF to individual file with automation?
- Different videos for different posts
- Add Class according to the order of appearance
- Preventing role reading others posts
- Enable comments for post when comments meta box removed
- Post visibility option to theme front-end for author to select?
- How to keep a record of changes to a custom field?
- Custom taxonomy not saving correctly
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Can I get an auto-populated dropdown list of other custom posts in a custom post edit page?
- Change user role when user’s first post gets published
- 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
- WordPress next post by ajax call on button click
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- Adding specific custom fields (images) to post excerpt
- My post loop needs to have 8 different post templates
- Front End users account with lots of user Roles (not Woocommerce)
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- CPT, Custom User Role and problem with user manager
- Display all post types together
- Collection of fields in a single post
- Display and Allow users to edit their own profiles
- Custom Post Type supports author
- What’s the best way to show custom post types? With page template it’s not perfect!
- How can I make a custom post type that loops pages in a new dashboard page, each single page is a new dashboard page (all within the back-end)?
- Custom post type & role issues
- How to add custom column to Custom post page list?
- Page template with custom query instead of archive-xxx.php?
- show posts under custom post type with same autj
- Delete old thumbnail when updating new