Admin custom option screen not saved unless user manage_options capability

I am running into exactly the problem described by this Trac: https://core.trac.wordpress.org/ticket/14365

I see that one of the devs added a Diff here: https://core.trac.wordpress.org/attachment/ticket/14365/14365.api.diff, which looks like it would add the ability to register the exact capability the user should have, to save the options -- without needing the user to have broad "manage_options" capability which I do not want them to have since it exposes too many other things in Admin.

OK, so that Diff looks good to me. But it looks like it was never implemented, and this Trac request was never really resolved.

Am I reading all of that correctly? There is no fix for this issue?

Seems I'd need to resort to something very ugly, like temporarily adding then removing "manage_options" capability (?)

Topic admin-menu capabilities Wordpress

Category Web


Alright...I found the answer. They implemented it as a filter (which for the life of me I could not figure out via that Trac).

See here: Proper use of option_page_capability_{$page_name}

Once I added the capability filter in my plugin options class - works like a charm.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.