Custom Fields
Re-Envisioned
Support MB Custom Post Type custom post type capabilities

  • Creator
    Topic
  • #11464
    Resolved brkard
    Participant

    Hi.

    I need to add some custom capabilities to cpts.

    Plugin is only permits post,page cababilites.

    For example i want to add movies cpt and give capability type movies.

    How can achive this ?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #11480
    Anh Tran
    Keymaster

    Hi Burak,

    Currently, it’s not supported yet. Let me try to figure a way to do it inside the plugin.

    #11486
    brkard
    Participant

    Hi Anh.

    It will be good feature if you can figure a way to do inside the plugin.

    Thank you very much.

    #13549
    meta_gecko
    Participant

    Any updates on this request? Unfortunately need to create own types for now because of the capabilities limitation..

    #13579
    Anh Tran
    Keymaster

    I’ve just updated the plugin today, adding a “Custom” rule for capability type. With that, the plugin auto generate capabilities for the new post type like: edit_cpt, delete_cpt. Please try and let me know how it goes.

    #13761
    meta_gecko
    Participant

    Hi Anh,

    Thanks for this, however it doesn’t appear to be complete. The custom capability is added, however the capabilities do not appear to be mapped to the core caps required by administrators (or any one else who is granted the capability) to edit published posts etc.

    There should be at least 11 capabilities for the admin role.

    *edit. adding all of the capabilities might not be necessary since they should be inherited.

    It seems that when registering the CPT using MB the mapping of the capabilities are missing:

    'map_meta_cap' => true,

    #13763
    meta_gecko
    Participant

    Just to confirm, adding 'map_meta_cap' => true, solves the problem. Doing so maps all of the primitive capabilities to the custom capability.

    #13769
    Anh Tran
    Keymaster

    Hi Guy,

    I’ve added that attribute. But in my test, even when adding it, the post type doesn’t show in the admin menu for admins to view/edit them.

    #13782
    meta_gecko
    Participant

    Hi Anh,

    It works fine, but when you add a custom capability then that capability needs to be given to any roles who need it, including administrators.

    This isn’t the responsibility of Meta Box, it’s up to the admin to provide the appropriate permissions to any roles that need it.

    The only thing I’d suggest is that you might want to add some information to the documentation because many people won’t know this otherwise.

    #13792
    Anh Tran
    Keymaster

    It works fine, but when you add a custom capability then that capability needs to be given to any roles who need it, including administrators.
    This isn’t the responsibility of Meta Box, it’s up to the admin to provide the appropriate permissions to any roles that need it.

    That’s correct. I think a plugin like Members would do the job better than Meta Box, since it’s too verbose for capability management.

    I’ll add the info to the docs when updating the plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.