(DDR) History
if ( ! function_exists('_ddr_register_post_type_history') ) {
// Register Custom Post Type
function _ddr_register_post_type_history() {
$labels = array(
'name' => _x( 'Essays', 'Post Type General Name', 'ddr' ),
'singular_name' => _x( 'Essay', 'Post Type Singular Name', 'ddr' ),
'menu_name' => __( 'Essays', 'ddr' ),
'name_admin_bar' => __( 'Essay', 'ddr' ),
'archives' => __( 'Essay Archives', 'ddr' ),
'attributes' => __( 'Essay Attributes', 'ddr' ),
'parent_item_colon' => __( 'Parent Essay:', 'ddr' ),
'all_items' => __( 'All Essays', 'ddr' ),
'add_new_item' => __( 'Add New Essay', 'ddr' ),
'add_new' => __( 'Add New', 'ddr' ),
'new_item' => __( 'New Essay', 'ddr' ),
'edit_item' => __( 'Edit Essay', 'ddr' ),
'update_item' => __( 'Update Essay', 'ddr' ),
'view_item' => __( 'View Essay', 'ddr' ),
'view_items' => __( 'View Essays', 'ddr' ),
'search_items' => __( 'Search Essay', 'ddr' ),
'not_found' => __( 'Not found', 'ddr' ),
'not_found_in_trash' => __( 'Not found in Trash', 'ddr' ),
'featured_image' => __( 'Featured Image', 'ddr' ),
'set_featured_image' => __( 'Set featured image', 'ddr' ),
'remove_featured_image' => __( 'Remove featured image', 'ddr' ),
'use_featured_image' => __( 'Use as featured image', 'ddr' ),
'insert_into_item' => __( 'Insert into Essay', 'ddr' ),
'uploaded_to_this_item' => __( 'Uploaded to this Essay', 'ddr' ),
'items_list' => __( 'Essays list', 'ddr' ),
'items_list_navigation' => __( 'Essays list navigation', 'ddr' ),
'filter_items_list' => __( 'Filter Essays list', 'ddr' ),
);
$rewrite = array(
'slug' => 'd-day-history',
'with_front' => true,
'pages' => false,
'feeds' => true,
);
$args = array(
'label' => __( 'Essay', 'ddr' ),
'description' => __( 'D-Day History', 'ddr' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'page-attributes' ),
'taxonomies' => array( 'category' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-book-alt',
'show_in_admin_bar' => false,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
'show_in_rest' => true,
);
register_post_type( 'history', $args );
}
add_action( 'init', '_ddr_register_post_type_history', 0 );
}