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
- Order properties should not be accessed directly
- Hide plugin dashboard menu item for specific roles
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- How to deal with equal & similar arguments for a function?
- PHP can I add line numbers to file_get_contents()
- Get rewrite slug of custom post type in template
- Executing a function upon webhook calling wordpress
- Customizer: widget-synced triggers twice
- WordPress not working on localhost
- Adding functions to hooks from within a class
- 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?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- get_posts() not working when accessing with a custom user role
- Is it possible to change a term slug before being saved to the database?
- Maximum lifetime for nonce
- Clearing caches on plugin uninstall
- How to use a hook to override an update_post_meta call in a plugin?
- Add code inside specific wordpress standard function
- How to customize a permalink (URL) structure?
- Custom Taxonomy to dropdown box on adminside wordpress
- Create a free scripts and styles template within a plugin
- Ability to only view (not edit) other user’s personal profile information
- Edit Yoast SEO breadcrumbs output [closed]
- Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin
- How would I go about creating a user ranked post popularity page?
- How to modify the comments to be displayed in a post?
- Define new user capability for custom post types?
- Redirection of users away from wp-admin (but not administrators)
- How can I turn a custom wordpress page into a product page?
- Set different custom menu items for different user roles
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How can we display product price $104 on the cart while the credit card payment method is checked?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Prevent third party plugin’s admin page access based on user type
- Incorporate small angular feature in my wordpress site
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- You do not have sufficient permissions to access this page on a submenu
- wp_dropdown_roles() to replace option value = code
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- Widget HTML Display Problem
- wordpress JSONAPI introspector always limits number at 10?
- Enqueue script globally
- Redirect to another page using contact form 7? [closed]
- How to modify files inside wp-includes directory in wordpress
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Custom entity search and display
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- Plugin: database creation
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- WordPress Specified file failed upload test
- Hide custom post type by user roles
- WordPress custom post type capabilities issue
- Hook called before text widget save
- Show message from backend
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Check user’s role and store in variable
- Make Database query only when option is updated
- Create Widget or Enable Shortcodes in Sidebar
- Getting a WordPress Debug Strategy
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Add User Role: Pre-saved in User-Meta [SOLVED]
- Logout after clicking URL link results in “headers already sent” error
- Loop in elementor custom widget not working
- how to save wp_editor html content in options table
- How to use gettext for specific user role
- Custom Registration username_exists / email_exists
- Why is it important to check for isset and is_array before checking in_array in this example?
- Working of foreach loop with array
- Converting core modification to a plugin
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Calling a save function from a “submit” button
- How to use a WP_Customize_Control outside of the Customizer?
- same user role or copy the user role to be same as the other role
- Unable to access custom plugin backend
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?