For example, if I create a post type called “destinations” does that automatically create capabilities like “edit_destinations” or “delete_destinations”?
Leave a Reply
You must be logged in to post a comment.
For example, if I create a post type called “destinations” does that automatically create capabilities like “edit_destinations” or “delete_destinations”?
You must be logged in to post a comment.
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
capabilities
value when usingregister_post_type
. See Justin Tadlock’s excellent tutorial here http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpressDefine a central variable for the custom post type:
public $post_type_1 = 'archiv';
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, when the plugin will be uninstalled.
You can see an example on this gist: https://gist.github.com/978690