Hi Greg,
Members takes all capabilities from the wp_user_roles option in wp_options table where WordPress stores all capabilities. It’s a serialized array, so it might not be easy to check this, but if you see capabilities from deleted plugins or you don’t see new capabilities, you can check if they are in that option.
Hopefully, that helps.
Just a quick update. Regarding capabilities that you don’t see, you can register capabilities or group capabilities by adding code snippet from this document: https://members-plugin.com/docs/snippets/
Best
Thread Starter
hrsms
(@hrsms)
I know only enough about WordPress programming to get myself in trouble, but I managed to avoid trouble this time.
You wrote:
“…if you see capabilities from deleted plugins”
There is no deleted plugin, rather deleted custom post types created with the active plugin (Pods).
With a little searching, I found how to delete the obsolete capabilities and add the missing capabilities using temporary ‘admin_init’ actions added to the end of my theme’s functions.php file (remove_cap / add_cap).
Your snippets page has a note:
“Note that custom post types are automatically registered as groups with Members.”
Groups are not being registered for custom post types created using the Pods plugin. It would be handy to group them, so also managed to use your members_register_cap_group snippet to do so. Thanks for all the information!
(Pods is fairly popular – you might consider working with them to make your two plugins compatible).
Thread Starter
hrsms
(@hrsms)
I’ve used your snippet to create a new group.
I’ve since found a custom post type that was created automatically (‘portfolio‘ from Visual Portfolio plugin). Some of the capabilities are in the Custom group instead of the Portfolio Items group. I’d like to move them.
Would it work to call members_register_cap_group using an existing group name but passing the new capabilities only? The complete set, new and old?
If not, how can I do this?
Thanks.
-
This reply was modified 1 year, 7 months ago by hrsms.
Thread Starter
hrsms
(@hrsms)
I wrote:
“(Pods is fairly popular – you might consider working with them to make your two plugins compatible).”
Please ignore. In the Pods admin I can change the type from page or post to Custom Type and the group appears automatically.
Thread Starter
hrsms
(@hrsms)
I wrote:
“I’ve since found a custom post type that was created automatically (‘portfolio‘ from Visual Portfolio plugin). Some of the capabilities are in the Custom group instead of the Portfolio Items group. I’d like to move them.”
Please ignore this also. I saw the note about members_unregister_cap_group.
I also used this for the Pods custom post types, as not all of the related capabilities get added to the automatically created groups.