The 3rd argument of add_options_page
is the capability required for this page to be displayed to the user.
Then to allow only admin to use this page, you have to set a capability which is only owned by admin, like activate_plugins
.
So change read
to activate_plugins
like this:
add_options_page( 'MyPlugin Options', 'MyPlugin Options', 'activate_plugins', 'myplugin-options', 'myplugin_options' );
Related Posts:
- How to prevent a post from being deleted?
- Deactivate plugin for a specific user group
- Publish author posts only with editor approval?
- How can I modify the Capability needed to access a plugin’s options?
- Limit access to posts/pages by user roles
- WordPress Capabilities: edit_user vs edit_users
- Disable text tab on WordPress text-editor
- Allowing Custom Capability to Manage Plugin Options
- Disable plugins for a specific user role
- User profiles and object associations
- How to assign user a role if none is present when logging in
- Woocommerce: change user role after completing order
- Specific post user permissions
- How can I let users to access plugin functions based on roles?
- Dynamic homepage according to user role
- Restricting users to a specific front end page [closed]
- Remove Adminstrator Hyperlink from a user having role to add and see users
- Enable comments for post with comments meta box removed
- Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end
- Checking for user role in a custom plugin
- WordPress roles – Protect administrator role
- wordpress custom login successful redirect hook
- Allow Facebook to preview posts before published
- Keep user’s privileges on accessing contents in JSON response
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- How create a role with admin capability less 1 or 2?
- Set user ID at time of wp_create_user
- Update User Role
- Plugin to restrict access to pages in wp-admin
- Getting user roles in plugin files
- How to achieve certain page (url) accessible to certain users
- How to write a plugin to add users to a mail list
- How to make a customize role and view a specific plugins base on that role?
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- Disable plugin per user role
- how to give a user a role?
- Redirection of users away from wp-admin (but not administrators)
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- WooCommerce specifc variations for specific user role [closed]
- How to create restrict content to users (by user, not by role)
- How to set add question capability for author role in wp pro quiz plugin
- How to create user that has permission to create new sites on WordPress with multisite option enabled?
- Can a Plugin Override New User Default Role Type
- can i limit editing specific custom fields to certain roles?
- Add user role to generated plugin
- Multisite – maximum number of users with specific role
- Is there any way to make myself an admin?
- Understanding State in WordPress Multisites
- How to allow Contributors to publish articles after approval
- Add User Role: Pre-saved in User-Meta [SOLVED]
- Multiple authors and readers restricted by role [closed]
- Custom Login page with custom redirects for each user?
- Show WordPress Plugin Menu(Admin) To Editor
- Mutliple users editing single document in wordspress
- Show media-uploads to all users
- Remove specific administrator’s capability
- Plugin permissions for Editor role
- How To Create A File Archive in WordPress?
- Role based permission edit for plugins
- Creating teams of users in WordPress
- WordPress Membership Plugin Advice [closed]
- How to hide plugin options for editors via functions.php
- Plugin privelages for “editors”
- Plugin access and Roles
- Plugin Hook When New Author Added
- Adding plugin editing capability for Author
- Show an admin menu item in Editor role
- implement custom roles in custom plugin
- Allow a particular user to access a particular plugin?
- See which user role / capability is needed to use a plugin
- Need help with Task assigning and rewarding as currency which withdrawable
- how to create user profile pages and display them based on users roles
- Allow a page to be edited by a specific custom role
- How to make this custom capability work? [duplicate]
- How to create different views for different user roles?
- Public WP website with one area just for members
- How can I disable access to plugin settings in wp admin for other roles
- Remove dashboard links from wordpress
- How to show private pages based on a user’s role?
- Disable plugin for administrator
- How do I restrict a second admin certain access?
- User / membership Plugin [closed]
- Restrict role to use a plugin
- Why user profile update creates Additional Capabilities
- Allow non-admin users to access plug-in
- Defined user role to access plugin’s pages
- Different email notifications (about pending posts) to different users
- Hide some portion on single.php base on author
- Custom User Role
- Want to add post to user dashboard
- Allow a role to edit one specific plugin
- WordPress Role Capability Restriction
- Zigconnect Plugin: Allowing editors to remove connections
- Sync roles across several plugins
- How to give different user access to different people?
- registration plugin [closed]
- How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
- How to disable plugin capability : “create new category”
- edit slider plugin capability for custom_role
- How to have certain products show for only certain users (Not roles)