• Resolved hrsms

    (@hrsms)


    I am attempting to edit a role so that the associated user can only create/modify/delete a particular custom post type.

    The custom post types are created using Pods.

    I can see permissions associated with the various custom post types I’ve created, e.g.,

    publish_<post type>
    edit_<post type>
    edit_others_<post type>
    delete_<post type>

    There are two related reasons I am writing:

    1) I can see permissions related to post types removed long ago. I could not find a way to clear these. Can you help?

    2) I am not seeing permissions related to the most recent post types that I have created. Is there some action I need to take? If there is an intermediate step I used in the past in order to see the currently visible post types, I’ve forgotten it

    Thanks,

    Greg

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Caseproof

    (@caseproof)

    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.

    Plugin Author Caseproof

    (@caseproof)

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom Post Type permissions – PODS’ is closed to new replies.