There is no right answer to this.
You need to use the capability or capabilities that allow the users you want to have access to have access and prevent the users you don’t want to have access from having access.
I would tend to create a capability and/or role in this kind of circumstance, but again, it depends on what you need.
It is pretty easy to create a role with add_role
. Also see add_cap
. A role management plugin can help you work out what you need and what you don’t.
Related Posts:
- Menu capability in WordPress
- What action should I hook into when adding roles and capabilities?
- What is valid timing of using current_user_can() and related functions?
- Allow Contributor to change the author of his own post?
- What’s the difference between Role and Meta capabilities; When to use map_meta_cap() filter
- How can I grant capabilities directly to users (not roles) in wp-admin?
- Disable posts, only allow to edit existing pages, not create new ones (create_posts)
- How to get all capabilities of an existing user role
- What exactly is WordPress?
- Does the “promote_users” capability allow someone to create a new admin account?
- current_user_can( ‘edit_post’, $post_id ) does not work for contributer but for administrator
- Add user capability and check against it
- Listing all capabilities in dropdown is returning boolean
- Add Media Upload Capabilities Needed for Custom Role for non-Posts
- Hooking into add_submenu_page
- add_cap only adding the first two in array
- Odd behaviour with submenu link creation
- How can I prevent a writer from being able to edit an article that has been scheduled?
- Check whether user can delete a given post
- How to change menu page capability
- Multiple Authors on Single Post
- Allow unfiltered HTML in titles for low level users?
- Allow users to set a post author
- Unify the roles and caps?
- current_user_can capabilities in the admin not working as expected
- Remove menu items from admin page and limit capabilities
- Filter list of rules based on a capability
- Using author_can() on custom post types in WordPress
- How to show a admin bar menu item only to users with certain capabilities?
- Restricted user capabilities cannot add image
- User capability per post
- How come I see a manage_categories capability but not a manage_tags capability for any users?
- Theme option editing capability problems
- Allow Contributor to edit published post and filter by page id
- Role capability issue
- Usage of current_user_can()
- Is it wise not to use only meta capabilities for certain basic post types?
- Remove capability from specific user
- What capabilities are assigned to unauthenticated users?
- Capabilities Not Changing
- Assign multiple roles , overlapping capabilities
- Administrator role capabilities
- How to get all capabilities
- Prevent all users from editing posts except admins using hooks
- WordPress remove capability post ,media completely for custom role
- Add capability to “Editor” role to be able to view all users attachments
- Why cannot author edit pages?
- Add capability to a role , so user is only able to view his own posts
- Plugin page and capabilities
- how to change capability required to view an admin page? [duplicate]
- How can restrict certain users from delete a category but can view only in wordpress?
- Delete admin edit/delete links in users list wordpress admin
- Create a Capability category to group a few custom Capabilities
- Capability to edit post slugs
- admin can not change author profile picture
- Changing capability type without altering plugin
- Can’t create new Pods pages
- Is there a way of retrieving the core WP capabilities?
- Best Roles and Capability on a site with review features using a front end custom post
- Not able to give editors acess to new admin menu item
- Manage Roles and Capabilities on Multi-site
- Groups of capabilities: users with multiple roles?
- Add menu and submenu in admin with a URL instead of slug?
- How to 301 private posts rather than 404?
- Allow user to Edit Posts but not Add New?
- Apply custom role capabilities to administrator (without plugin)
- How can I prevent users from creating new categories?
- Author Role – Allow editing of Gallery images
- What is the difference between “create_users” and “add_users” capabilities?
- add_submenu_page set for multiple roles [duplicate]
- Role Capabilities: Add New Ones?
- Custom post type capabilities require “create_posts” to access the edit posts list page
- add_menu_page() for more than one user role
- Why is my Custom Post Type not showing up after adding capabilities?
- Roles for Custom Post Types
- can’t see custom post content filtered under “mine” filter in admin panel
- read_post meta capability for anonymous users
- add_cap not working
- Restrict edit, but allow preview for custom post status
- How to set custom capabilities for custom taxonomies?
- Custom Capabilities for CPT and Problem with current_user_can()
- add_submenu_page() issue
- current_user_can(‘administrator’) not working in custom login
- Let editors view post in admin but not be able to perform a save/edit
- Capabilities don’t add
- Remove specific administrator’s capability
- How to let a role handle media without post permissions
- How to determine which capability to use?
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Adding all custom capabilities to admin
- current_user_can( ‘edit_user’ ) does not work
- Author Error “Sorry, you are not allowed to access this page.”
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- Check what capabilitie(s) an action requires
- How to add capabilities for editor type user to access admin section
- Hide menu theme location for certain capabilities?
- Custom post type submenu sorted by specific meta_key & meta_value
- How do I make a draft post accessible to everyone?
- Want to add post to user dashboard
- How might I enable a user to view Draft pages from a different Author, without the ability to edit?