i-recommend-this icon indicating copy to clipboard operation
i-recommend-this copied to clipboard

Make options page only accessible to users with correct permission

Open hchouhan opened this issue 7 years ago • 1 comments

https://developer.wordpress.org/plugins/security/checking-user-capabilities/

hchouhan avatar Sep 02 '18 14:09 hchouhan

I tested this with an editor-level user and it's working as expected. When you create the options page and its menu item with add_options_page, the capability you set as the third parameter controls both the menu item display and page access. You have it set to manage_options, so by default only admins will see and be able to access it.

If you have a need to, you can also use this filter after the fact.

FPCSJames avatar Sep 12 '18 17:09 FPCSJames

This has already been fixed so closing the ticket.

hchouhan avatar Jun 27 '24 14:06 hchouhan