Collection Post Type
if ( ! function_exists('collection_post_type') ) {
// Register Custom Post Type
function collection_post_type() {
$labels = array(
'name' => _x( 'Collections', 'Post Type General Name', 'WBB' ),
'singular_name' => _x( 'Collection', 'Post Type Singular Name', 'WBB' ),
'menu_name' => __( 'Collections', 'WBB' ),
'name_admin_bar' => __( 'Collections', 'WBB' ),
'archives' => __( 'Collections Archives', 'WBB' ),
'attributes' => __( 'Collections Attributes', 'WBB' ),
'parent_item_colon' => __( 'Parent Collections:', 'WBB' ),
'all_items' => __( 'All Collections', 'WBB' ),
'add_new_item' => __( 'Add New Collection', 'WBB' ),
'add_new' => __( 'Add New Collection', 'WBB' ),
'new_item' => __( 'New Collection', 'WBB' ),
'edit_item' => __( 'Edit Collection', 'WBB' ),
'update_item' => __( 'Update Collection', 'WBB' ),
'view_item' => __( 'View Collection', 'WBB' ),
'view_items' => __( 'View Collections', 'WBB' ),
'search_items' => __( 'Search Collections', 'WBB' ),
'not_found' => __( 'Not found', 'WBB' ),
'not_found_in_trash' => __( 'Not found in Trash', 'WBB' ),
'featured_image' => __( 'Collection Featured Image', 'WBB' ),
'set_featured_image' => __( 'Set Collection featured image', 'WBB' ),
'remove_featured_image' => __( 'Remove Collection featured image', 'WBB' ),
'use_featured_image' => __( 'Use as Collection featured image', 'WBB' ),
'insert_into_item' => __( 'Insert into Collection', 'WBB' ),
'uploaded_to_this_item' => __( 'Uploaded to this Collection', 'WBB' ),
'items_list' => __( 'Collections list', 'WBB' ),
'items_list_navigation' => __( 'Collections list navigation', 'WBB' ),
'filter_items_list' => __( 'Filter Collections list', 'WBB' ),
);
$args = array(
'label' => __( 'Collection', 'WBB' ),
'description' => __( 'About Collections', 'WBB' ),
'labels' => $labels,
'supports' => array( 'title', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-media-document',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => false,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'collection', $args );
}
add_action( 'init', 'collection_post_type', 0 );
}