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