

Top ↑ capabilities ( array) ( optional) An array of the capabilities for this post type. Note 3: If you use capabilities parameter, capability_type complete your capabilities. Some of the capability types that can be used (probably not exhaustive list): Primitive capabilities used within map_meta_cap(): Primitive capabilities used outside of map_meta_cap(): You can take a look into the $GLOBALS array, then you’ll see the following: => stdClass Object Note 2: See capabilities note 2 about meta capabilities mapping for custom post type. Note 1: The “create_posts” capability correspond to “edit_books” so it become equal to “edit_posts”. 'read_private_posts' => 'read_private_books', 'edit_others_posts' => 'edit_others_books', Default: “post” Example with “book” or “array( ‘book’, ‘books’ )” value, it will generate the 7 capabilities equal to set capabilities parameter to this : 'capabilities' => array( It seems that `map_meta_cap` needs to be set to false or null, to make this work (see note 2 below). The ‘capability_type’ parameter is used as a base to construct capabilities unless they are explicitly set with the ‘capabilities’ parameter. array(‘story’, ‘stories’) the first array element will be used for the singular capabilities and the second array element for the plural capabilities, this is instead of the auto generated version if no array is given which would be “storys”. May be passed as an array to allow for alternative plurals when using this argument as a base to construct the capabilities, e.g. Top ↑ capability_type ( string or array) ( optional) The string to use to build the read, edit, and delete capabilities. In general, you should always prefix your post types, or specify a custom `query_var`, to avoid conflicting with existing WordPress query variables. In addition, the following post types should not be used as they interfere with other WordPress functions. The following post types are reserved and are already used by WordPress. This can lead to unexpected results and failures.Įven if you register a taxonomy while creating the post type, you must still explicitly register and define the taxonomy using register_taxonomy(). If you do not, the taxonomies and post type will not be recognized as connected when using filters such as parse_query or pre_get_posts. When registering a post type, always register your taxonomies using the taxonomies argument.

post type, even if you switch between your themes.

See Must Use Plugins If you want to keep your changes e.g. However, if you use it in a theme, your post type will disappear from the admin if a user switches away from your theme. You can use this function in themes and plugins. WP_Post_Type| WP_Error The registered post type object on success, WP_Error object on failure.
TYPEBOOK CREATOR SERIAL NUMBER REGISTRATION
$args ) Post type registration arguments. More Arguments from get_post_type_capabilities(. Top ↑ Parameters $post_type string RequiredįOR INTERNAL USE ONLY! URL segment to use for edit link of this post type. See the $supports argument for a complete list of supported features. Post types can support any number of built-in core features such as meta boxes, custom fields, post thumbnails, post statuses, comments, and more. Also, any taxonomy connections should be registered via the $taxonomies argument to ensure consistency when hooks such as ‘parse_query’ or ‘pre_get_posts’ are used. Note: Post type registrations should not be hooked before the ‘init’ action.
