// Post Type registration.
* Creates the initial post types when 'init' action is fired.
function create_initial_post_types() {
WP_Post_Type::reset_default_labels();
'name_admin_bar' => _x( 'Post', 'add new from admin bar' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'menu_icon' => 'dashicons-admin-post',
'delete_with_user' => true,
'editor' => array( 'notes' => true ),
'rest_controller_class' => 'WP_REST_Posts_Controller',
'name_admin_bar' => _x( 'Page', 'add new from admin bar' ),
'publicly_queryable' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'page',
'menu_icon' => 'dashicons-admin-page',
'delete_with_user' => true,
'editor' => array( 'notes' => true ),
'rest_controller_class' => 'WP_REST_Posts_Controller',
'name' => _x( 'Media', 'post type general name' ),
'name_admin_bar' => _x( 'Media', 'add new from admin bar' ),
'add_new' => __( 'Add Media File' ),
'add_new_item' => __( 'Add Media File' ),
'edit_item' => __( 'Edit Media' ),
'view_item' => ( '1' === get_option( 'wp_attachment_pages_enabled' ) ) ? __( 'View Attachment Page' ) : __( 'View Media File' ),
'attributes' => __( 'Attachment Attributes' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'create_posts' => 'upload_files',
'menu_icon' => 'dashicons-admin-media',
'show_in_nav_menus' => false,
'delete_with_user' => true,
'supports' => array( 'title', 'author', 'comments' ),
'rest_controller_class' => 'WP_REST_Attachments_Controller',
add_post_type_support( 'attachment:audio', 'thumbnail' );
add_post_type_support( 'attachment:video', 'thumbnail' );
'name' => __( 'Revisions' ),
'singular_name' => __( 'Revision' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'delete_with_user' => true,
'supports' => array( 'author' ),
'name' => __( 'Navigation Menu Items' ),
'singular_name' => __( 'Navigation Menu Item' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'delete_with_user' => false,
'capability_type' => array( 'edit_theme_options', 'edit_theme_options' ),
'edit_post' => 'edit_post',
'read_post' => 'read_post',
'delete_post' => 'delete_post',
// Primitive Capabilities.
'edit_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
'delete_posts' => 'edit_theme_options',
'publish_posts' => 'edit_theme_options',
'read_private_posts' => 'edit_theme_options',
'delete_private_posts' => 'edit_theme_options',
'delete_published_posts' => 'edit_theme_options',
'delete_others_posts' => 'edit_theme_options',
'edit_private_posts' => 'edit_theme_options',
'edit_published_posts' => 'edit_theme_options',
'rest_base' => 'menu-items',
'rest_controller_class' => 'WP_REST_Menu_Items_Controller',
'name' => __( 'Custom CSS' ),
'singular_name' => __( 'Custom CSS' ),
'delete_with_user' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'supports' => array( 'title', 'revisions' ),
'delete_posts' => 'edit_theme_options',
'delete_post' => 'edit_theme_options',
'delete_published_posts' => 'edit_theme_options',
'delete_private_posts' => 'edit_theme_options',
'delete_others_posts' => 'edit_theme_options',
'edit_post' => 'edit_css',
'edit_posts' => 'edit_css',
'edit_others_posts' => 'edit_css',
'edit_published_posts' => 'edit_css',
'read_private_posts' => 'read',
'publish_posts' => 'edit_theme_options',
'name' => _x( 'Changesets', 'post type general name' ),
'singular_name' => _x( 'Changeset', 'post type singular name' ),
'add_new' => __( 'Add Changeset' ),
'add_new_item' => __( 'Add Changeset' ),
'new_item' => __( 'New Changeset' ),
'edit_item' => __( 'Edit Changeset' ),
'view_item' => __( 'View Changeset' ),
'all_items' => __( 'All Changesets' ),
'search_items' => __( 'Search Changesets' ),
'not_found' => __( 'No changesets found.' ),
'not_found_in_trash' => __( 'No changesets found in Trash.' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'delete_with_user' => false,
'supports' => array( 'title', 'author' ),
'capability_type' => 'customize_changeset',
'create_posts' => 'customize',
'delete_others_posts' => 'customize',
'delete_post' => 'customize',
'delete_posts' => 'customize',
'delete_private_posts' => 'customize',
'delete_published_posts' => 'customize',
'edit_others_posts' => 'customize',
'edit_post' => 'customize',
'edit_posts' => 'customize',
'edit_private_posts' => 'customize',
'edit_published_posts' => 'do_not_allow',
'publish_posts' => 'customize',
'read_post' => 'customize',
'read_private_posts' => 'customize',
'name' => __( 'oEmbed Responses' ),
'singular_name' => __( 'oEmbed Response' ),
'delete_with_user' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'name' => __( 'User Requests' ),
'singular_name' => __( 'User Request' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'delete_with_user' => false,
'name' => _x( 'Patterns', 'post type general name' ),
'singular_name' => _x( 'Pattern', 'post type singular name' ),
'add_new' => __( 'Add Pattern' ),
'add_new_item' => __( 'Add Pattern' ),
'new_item' => __( 'New Pattern' ),
'edit_item' => __( 'Edit Block Pattern' ),
'view_item' => __( 'View Pattern' ),
'view_items' => __( 'View Patterns' ),
'all_items' => __( 'All Patterns' ),
'search_items' => __( 'Search Patterns' ),
'not_found' => __( 'No patterns found.' ),
'not_found_in_trash' => __( 'No patterns found in Trash.' ),
'filter_items_list' => __( 'Filter patterns list' ),
'items_list_navigation' => __( 'Patterns list navigation' ),
'items_list' => __( 'Patterns list' ),
'item_published' => __( 'Pattern published.' ),
'item_published_privately' => __( 'Pattern published privately.' ),
'item_reverted_to_draft' => __( 'Pattern reverted to draft.' ),
'item_scheduled' => __( 'Pattern scheduled.' ),
'item_updated' => __( 'Pattern updated.' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'rest_controller_class' => 'WP_REST_Blocks_Controller',
'capability_type' => 'block',
// You need to be able to edit posts, in order to read blocks in their raw form.
// You need to be able to publish posts, in order to create blocks.
'create_posts' => 'publish_posts',
'edit_posts' => 'edit_posts',
'edit_published_posts' => 'edit_published_posts',
'delete_published_posts' => 'delete_published_posts',
// Enables trashing draft posts as well.
'delete_posts' => 'delete_posts',
'edit_others_posts' => 'edit_others_posts',
'delete_others_posts' => 'delete_others_posts',
$template_edit_link = 'site-editor.php?' . build_query(
'name' => _x( 'Templates', 'post type general name' ),
'singular_name' => _x( 'Template', 'post type singular name' ),
'add_new' => __( 'Add Template' ),
'add_new_item' => __( 'Add Template' ),
'new_item' => __( 'New Template' ),
'edit_item' => __( 'Edit Template' ),
'view_item' => __( 'View Template' ),
'all_items' => __( 'Templates' ),
'search_items' => __( 'Search Templates' ),
'parent_item_colon' => __( 'Parent Template:' ),
'not_found' => __( 'No templates found.' ),
'not_found_in_trash' => __( 'No templates found in Trash.' ),
'archives' => __( 'Template archives' ),
'insert_into_item' => __( 'Insert into template' ),
'uploaded_to_this_item' => __( 'Uploaded to this template' ),
'filter_items_list' => __( 'Filter templates list' ),
'items_list_navigation' => __( 'Templates list navigation' ),
'items_list' => __( 'Templates list' ),
'item_updated' => __( 'Template updated.' ),
'description' => __( 'Templates to include in your theme.' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => $template_edit_link, /* internal use only. don't use this when registering your own post type. */
'rest_base' => 'templates',
'rest_controller_class' => 'WP_REST_Templates_Controller',
'autosave_rest_controller_class' => 'WP_REST_Template_Autosaves_Controller',
'revisions_rest_controller_class' => 'WP_REST_Template_Revisions_Controller',
'late_route_registration' => true,
'capability_type' => array( 'template', 'templates' ),
'create_posts' => 'edit_theme_options',
'delete_posts' => 'edit_theme_options',
'delete_others_posts' => 'edit_theme_options',
'delete_private_posts' => 'edit_theme_options',
'delete_published_posts' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
'edit_private_posts' => 'edit_theme_options',
'edit_published_posts' => 'edit_theme_options',
'publish_posts' => 'edit_theme_options',
'read' => 'edit_theme_options',
'read_private_posts' => 'edit_theme_options',
'name' => _x( 'Template Parts', 'post type general name' ),
'singular_name' => _x( 'Template Part', 'post type singular name' ),
'add_new' => __( 'Add Template Part' ),
'add_new_item' => __( 'Add Template Part' ),
'new_item' => __( 'New Template Part' ),
'edit_item' => __( 'Edit Template Part' ),
'view_item' => __( 'View Template Part' ),
'all_items' => __( 'Template Parts' ),
'search_items' => __( 'Search Template Parts' ),
'parent_item_colon' => __( 'Parent Template Part:' ),
'not_found' => __( 'No template parts found.' ),
'not_found_in_trash' => __( 'No template parts found in Trash.' ),
'archives' => __( 'Template part archives' ),
'insert_into_item' => __( 'Insert into template part' ),
'uploaded_to_this_item' => __( 'Uploaded to this template part' ),
'filter_items_list' => __( 'Filter template parts list' ),
'items_list_navigation' => __( 'Template parts list navigation' ),
'items_list' => __( 'Template parts list' ),
'item_updated' => __( 'Template part updated.' ),
'description' => __( 'Template parts to include in your templates.' ),
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => $template_edit_link, /* internal use only. don't use this when registering your own post type. */
'rest_base' => 'template-parts',
'rest_controller_class' => 'WP_REST_Templates_Controller',
'autosave_rest_controller_class' => 'WP_REST_Template_Autosaves_Controller',
'revisions_rest_controller_class' => 'WP_REST_Template_Revisions_Controller',
'late_route_registration' => true,
'create_posts' => 'edit_theme_options',
'delete_posts' => 'edit_theme_options',
'delete_others_posts' => 'edit_theme_options',
'delete_private_posts' => 'edit_theme_options',
'delete_published_posts' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
'edit_private_posts' => 'edit_theme_options',
'edit_published_posts' => 'edit_theme_options',
'publish_posts' => 'edit_theme_options',
'read' => 'edit_theme_options',
'read_private_posts' => 'edit_theme_options',
'label' => _x( 'Global Styles', 'post type general name' ),