Not sure is that a rule or just something that happens to work that way, but most of function that take capability as argument also accept roles in same argument.
If I am not mistaken passing lowest role you want to grant access ('author'
) should work for that role and upwards. Please test before use.
Related Posts:
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- How to Change the Entire WordPress Admin panel Look and Feel?
- How to Structure a New Role/Capability Scheme?
- How to allow Unfiltered HTML in a wordpress multisite install
- Applying OO patterns and principles to plugin development
- Limit role to one plugin [duplicate]
- Logout users upon login, based on caps/role?
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Setting a post’s category
- Allow contributor user role to perform copy operation PHP
- How to give custom roles the capability to edit one Menu instead of every Menu
- Buddy Press restrict the capability to edit users
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Best way to abort plugin in case of insufficient PHP version?
- Where to store PHP files created by plugin / themes
- What do you think about custom designed plugin/theme options UIs?
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- Send user activation email when programmatically creating user
- What is the correct way to build a widget using OOP
- Optimize shortcode callbacks
- Which to use to execute code during the saving of a plugin settings page?
- Has anyone managed to integrate the wp_editor inside a widget?
- Using Primary Color in Plugin Block
- When is it appropriate to put functions on page template vs. functions.php?
- Editor role cannot save custom theme options
- How to create custom home page via plugin?
- Sessions not creating correctly in custom function
- $wp_filesystem returns NULL. What are the dependencies?
- Featured Image not showing in admin
- Odd behaviour with submenu link creation
- Authenticating to WordPress, using my own authentication two-factor system
- How to store accumulate multiple option values in a single array using Options_API
- Checking for user role in a custom plugin
- Get the password key when using the wp_new_user_notification_email filter
- Order properties should not be accessed directly
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- How to deal with equal & similar arguments for a function?
- Get rewrite slug of custom post type in template
- Executing a function upon webhook calling wordpress
- Customizer: widget-synced triggers twice
- how to use hook deleted_user into custom function to delete user from custom table
- Disable The Events Calendar plugin from loading its scripts
- Where to store the name of a custom table?
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- get_posts() not working when accessing with a custom user role
- Clearing caches on plugin uninstall
- Custom Taxonomy to dropdown box on adminside wordpress
- Ability to only view (not edit) other user’s personal profile information
- How to modify the comments to be displayed in a post?
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Widget HTML Display Problem
- Redirect to another page using contact form 7? [closed]
- How to modify files inside wp-includes directory in wordpress
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Hook called before text widget save
- Show message from backend
- Create Widget or Enable Shortcodes in Sidebar
- Getting a WordPress Debug Strategy
- how to save wp_editor html content in options table
- Why is it important to check for isset and is_array before checking in_array in this example?
- Working of foreach loop with array
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Unable to access custom plugin backend
- How to remove/replace current page template?
- Adding Permalink to Slides with ‘Simple Nivo Slider’ plugin?
- insufficient permissions; coding an action for plugin governed by custom capability
- Why doesn’t update_post_meta work for certain strings?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Move plugin pages from dashboard to front-end
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Add custom parameter for custom user role
- Autoloading Classes in Plugins
- Determine if the current page, is being edited
- How I can give access to my custom plugin for editor roles user?
- Making adding info to an overlay bio easy for average user?
- Remove from a div by class name from post page if post author role is not administrator
- Adding admin for specific users
- New Users are saved with no role selected
- Associating special meaning with user id 0
- WordPress User Management Departmental Managers
- Theming Custom Plugin Page
- Users can only save their draft once before saving for revision
- Link to a admin submenu item using a custom link
- Dynamic banner for use on external sites
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- Custom plugin not appearing
- Remove default wordpress roles
- How to lock users account until approvation
- Is there any other ways to replicating changes on live from staging without pushing from git
- Can I log the searches that are returning 404 in the DB?
- How to make a Template page to show the information of different things Shop and Product page?