Books CPT (July 2017)
if ( ! function_exists('book') ) {
// Register Custom Post Type
function book() {
$labels = array(
'name' => _x( 'books', 'Post Type General Name', 'lmabee' ),
'singular_name' => _x( 'book', 'Post Type Singular Name', 'lmabee' ),
'menu_name' => __( 'Books', 'lmabee' ),
'name_admin_bar' => __( 'Book Post Type', 'lmabee' ),
'archives' => __( 'Book Archives', 'lmabee' ),
'attributes' => __( 'Book Attributes', 'lmabee' ),
'parent_item_colon' => __( 'Parent Book:', 'lmabee' ),
'all_items' => __( 'All Books', 'lmabee' ),
'add_new_item' => __( 'Add New Book', 'lmabee' ),
'add_new' => __( 'Add New Book', 'lmabee' ),
'new_item' => __( 'New Book', 'lmabee' ),
'edit_item' => __( 'Edit Book', 'lmabee' ),
'update_item' => __( 'Update Book', 'lmabee' ),
'view_item' => __( 'View Book', 'lmabee' ),
'view_items' => __( 'View Books', 'lmabee' ),
'search_items' => __( 'Search Book', 'lmabee' ),
'not_found' => __( 'Not found', 'lmabee' ),
'not_found_in_trash' => __( 'Not found in Trash', 'lmabee' ),
'featured_image' => __( 'Featured Image', 'lmabee' ),
'set_featured_image' => __( 'Set featured image', 'lmabee' ),
'remove_featured_image' => __( 'Remove featured image', 'lmabee' ),
'use_featured_image' => __( 'Use as featured image', 'lmabee' ),
'insert_into_item' => __( 'Insert into book', 'lmabee' ),
'uploaded_to_this_item' => __( 'Uploaded to this book', 'lmabee' ),
'items_list' => __( 'Books list', 'lmabee' ),
'items_list_navigation' => __( 'Books list navigation', 'lmabee' ),
'filter_items_list' => __( 'Filter books list', 'lmabee' ),
);
$args = array(
'label' => __( 'book', 'lmabee' ),
'description' => __( 'Books on Romanov and Russian History', 'lmabee' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'book_category' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-book-alt',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'Books', $args );
}
add_action( 'init', 'book', 0 );
}