Register a post type. Do not use before init.
A function for creating or modifying a post type based on the
parameters given. The function will accept an array (second optional
parameter), along with a string for the post type name.
Optional $args contents:
- label - Name of the post type shown in the menu. Usually plural. If not set, labels['name'] will be used.
- description - A short descriptive summary of what the post type is. Defaults to blank.
- public - Whether posts of this type should be shown in the admin UI. Defaults to false.
- exclude_from_search - Whether to exclude posts with this post type from search results.
Defaults to true if the type is not public, false if the type is public.
- publicly_queryable - Whether post_type queries can be performed from the front page.
Defaults to whatever public is set as.
- show_ui - Whether to generate a default UI for managing this post type. Defaults to true
if the type is public, false if the type is not public.
- show_in_menu - Where to show the post type in the admin menu. True for a top level menu,
false for no menu, or can be a top level page like 'tools.php' or 'edit.php?post_type=page'.
show_ui must be true.
- menu_position - The position in the menu order the post type should appear. Defaults to the bottom.
- menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
- capability_type - The string to use to build the read, edit, and delete capabilities. Defaults to 'post'.
May be passed as an array to allow for alternative plurals when using this argument as a base to construct the
capabilities, e.g. array('story', 'stories').
- capabilities - Array of capabilities for this post type. By default the capability_type is used
as a base to construct capabilities. You can see accepted values in {@link get_post_type_capabilities()}.
- map_meta_cap - Whether to use the internal default meta capability handling. Defaults to false.
- hierarchical - Whether the post type is hierarchical. Defaults to false.
- supports - An alias for calling add_post_type_support() directly. See {@link add_post_type_support()}
for documentation. Defaults to none.
- register_meta_box_cb - Provide a callback function that will be called when setting up the
meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
- taxonomies - An array of taxonomy identifiers that will be registered for the post type.
Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or
register_taxonomy_for_object_type().
- labels - An array of labels for this post type. By default post labels are used for non-hierarchical
types and page labels for hierarchical ones. You can see accepted values in {@link get_post_type_labels()}.
- has_archive - True to enable post type archives. Will generate the proper rewrite rules if rewrite is enabled.
- rewrite - false to prevent rewrite. Defaults to true. Use array('slug'=>$slug) to customize permastruct;
default will use $post_type as slug. Other options include 'with_front', 'feeds', 'pages', and 'ep_mask'.
- query_var - false to prevent queries, or string to value of the query var to use for this post type
- can_export - true allows this post type to be exported.
- show_in_nav_menus - true makes this post type available for selection in navigation menus.
- _builtin - true if this post type is a native or "built-in" post_type. THIS IS FOR INTERNAL USE ONLY!
- _edit_link - URL segement to use for edit link of this post type. THIS IS FOR INTERNAL USE ONLY!