For example, if I create a post type called "destinations" does that automatically create capabilities like "edit_destinations" or "delete_destinations"?
|
It does not automatically create that capability in the sense that there is no new capability registered with WordPress. Instead it defaults to use the capabilities assigned to creating/editing posts. For example, if an author logs in they will be able to create and publish a new destination entry by default. You can override this with the |
|||
|
|
I define a central var for the custom post type: and use this on add new capabilities:
Also i add this new capabilties objects to the differnet default roles, only on activation of the plugin:
But, you must also unregister this objects, if the plugin will be uninstalled. You can see an example on this gist: https://gist.github.com/978690 |
|||||||||||||
|