• Hi,

    I’ve created a custom post type called ‘ypt’ using code I’ve found on stackexchange. This custom post type uses “ypt” as capability_type and defined “map_meta_cap” as true.

    Thus, dumping the variables created for the new post type, I get this:

    [“cap”]=> object(stdClass)#4206 (15) { [“edit_post”]=> string(8) “edit_ypt” [“read_post”]=> string(8) “read_ypt” [“delete_post”]=> string(10) “delete_ypt” [“edit_posts”]=> string(9) “edit_ypts” [“edit_others_posts”]=> string(16) “edit_others_ypts” [“publish_posts”]=> string(12) “publish_ypts” [“read_private_posts”]=> string(17) “read_private_ypts” [“read”]=> string(4) “read” [“delete_posts”]=> string(11) “delete_ypts” [“delete_private_posts”]=> string(19) “delete_private_ypts” [“delete_published_posts”]=> string(21) “delete_published_ypts” [“delete_others_posts”]=> string(18) “delete_others_ypts” [“edit_private_posts”]=> string(17) “edit_private_ypts” [“edit_published_posts”]=> string(19) “edit_published_ypts” [“create_posts”]=> string(9) “edit_ypts” }

    However, these post-type-specific capabilities aren’t listed at all in the user-role-editor.

    I assume I’m making a mistake somewhere, or something has changed in WP, because in previous installations I’ve worked with, the user role editor always showed per post-type capabilities as soon as the custom post types were created.

    If I’m doing something wrong, I’d appreciate your help. If not, maybe this is a bug?

    Thanks!

    https://www.ads-software.com/plugins/user-role-editor/

    Oh, I forgot – it’s a WPMU installation, but I tried in a standard installation and it didn’t help the problem.

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

    (@shinephp)

    Hi,

    Let me do not agree.
    When you use custom capabilities at the custom post type definition you define permission model for this custom post type, but do not add any new capability to any role. Those custom capabilities do not exist for WordPress.
    Add the code which adds new custom capabilities to the ‘administrator’ role and you will see them at User Role Editor.
    At multisite it should be done for every site as every site has its own roles set.

    Thread Starter t.schwarz

    (@tschwarz-1)

    Hi,

    thanks for your reply! I’m not sure I understand – what you’re saying is that WP disregards a specifically created permission model for the post type by default? And instead used the standard model? I can post ypts as admin even though theoretically I should not have “publish_ypt” capability according to your reply…

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    May be I should use the “map” word instead of the “model”. Creating the custom post you may create the map between custom and built-in capabilities set. WordPress substitutes custom capability instead of built-in one when checking of the built-in capability is required.
    But custom capabilities are not created automatically.

    WordPress allows ALL to the superadmin under multisite inspite of actual capabilities of his role. Do you post ypts under multisite superadmin?

    Thread Starter t.schwarz

    (@tschwarz-1)

    Ah, ok, thanks! now that makes sense! I did post them as superadmin. I created custom roles and added the custom capabilities of the custom post type, now it works =)

    Thanks again!!! Super useful plugin!

    Hi,
    Can you help for setting up “author” roles or capability (I don’t witch is right, beacause I’m not programmer) for a premium plugin that I purchased called Wp Scarcity Rocket. It looks to me like there’s no such features into places for this particular plugin. Meaning that only site admin can use the plugin from wp-admin (both single wp install or multi-sites intallation). I’m will to pay if not to expensive.

    Thank you
    Regards

    *video on youtube: https://www.youtube.com/watch?v=3tafKeS8fwA

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    Send the installation package of ‘Wp Scarcity Rocket’ to support [at-sign] role-editor.com
    I will use it for the evaluation and test purpose only.
    It could take 1-2 days.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘New Custom Capabilities created by Custom Post Type aren't shown’ is closed to new replies.