[Plugin: WP-Wiki] How to restrict “Wiki Editor” capabilities?
It lets you flag certain pages and posts as “Wiki-Editable,” and creates a new type of user called a “Wiki Editor.” Wiki Editors can only edit pages which are marked Wiki-Editable. The problem is, they can also edit all posts, whether those posts are marked Wiki-Editable or not.
This is not good.
Here’s the code where it sets up a new capability called ‘edit_wiki’: http://wordpress.pastebin.com/sijSz4p9
And here’s the new function it creates, which checks for edit_wiki capability before deciding whether or not to allow the user to edit a page: http://wordpress.pastebin.com/cj3SReYz
I’d like to change it so that Wiki Editors can edit posts (not just pages) which are Wiki-Editable but can’t edit any others. My assumption right now is that I need to comment out more of those granted roles, then write a new function that works like
wiki_page_capexcept for posts.
- Am I on the right track?
- How the heck do I do this? I’m almost completely new to PHP and WordPress plugin development.
Any help would be appreciated. >.>b
- The topic ‘[Plugin: WP-Wiki] How to restrict “Wiki Editor” capabilities?’ is closed to new replies.