admin管理员组文章数量:1122832
I am running into exactly the problem described by this Trac:
I see that one of the devs added a Diff here: .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 (?)
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 (?)
Share Improve this question asked Nov 10, 2015 at 18:23 C CC C 1,95818 silver badges31 bronze badges 4- In general I think that if you need to give a non admin the ability to save options then you are doing something wrong. Content people should not have the ability to change the way the site work. The only justification I can see is two tiers of admins, but I never heard of that in real life.. – Mark Kaplun Commented Nov 10, 2015 at 19:15
- These options have nothing to do with the way the site works. I'm building a website generator. This options page contains text items like "business phone number", "business address", "business name", etc. They fill out the options, select one of my themes and boom - they have a website. I have everything in Admin locked down except this one options page they work with, and a custom post type for rich text/media they may also provide for their site. – C C Commented Nov 10, 2015 at 19:57
- Possible duplicate of Cheating, are we? Editor role not saving settings page for custom post type – leymannx Commented Apr 16, 2019 at 20:33
- Sorry, I guess my time machine wasn't working correctly when I asked the question originally, in 2015... – C C Commented Apr 23, 2019 at 20:36
1 Answer
Reset to default 0Alright...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.
本文标签: capabilitiesAdmin custom option screen not saved unless user manageoptions capability
版权声明:本文标题:capabilities - Admin custom option screen not saved unless user manage_options capability 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736287550a1927903.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论