When working with WordPress menu page permissions, you there’s a chance that you’ll eventually come across the “Cheatin’ uh?” message.
In short, this particular message shows up whenever a user of a certain role with a certain set of capabilities is trying to do something that they aren’t permitted to do. For example, say that you have an Editor who is trying to save options on a page created by the Settings API.
Technically speaking, this should be straightforward:
- Create the options menu (via, say, add_menu_page)
- Populate the page using the Settings API
- Allow the user to save the information
When defining add_menu_page
, you have to specify a capability for which the user has the ability to save the options. Luckily, the Codex has a page that makes it really easy to know what capabilities are available to each role.
But what happens when you’ve defined a capability for a menu page and you’re still getting an error message when trying to save the data?