HE Trails
CPT for HE Trails Library
if ( ! function_exists('he_cpt_trails') ) {
// Register Custom Post Type
function he_cpt_trails() {
$labels = array(
'name' => _x( 'Trails', 'Post Type General Name', 'he_trails' ),
'singular_name' => _x( 'Trail', 'Post Type Singular Name', 'he_trails' ),
'menu_name' => __( 'Trails', 'he_trails' ),
'parent_item_colon' => __( 'Parent Trail:', 'he_trails' ),
'all_items' => __( 'All Trails', 'he_trails' ),
'view_item' => __( 'View Trail', 'he_trails' ),
'add_new_item' => __( 'Add New Trail', 'he_trails' ),
'add_new' => __( 'Add Trail', 'he_trails' ),
'edit_item' => __( 'Edit Trail', 'he_trails' ),
'update_item' => __( 'Update Trail', 'he_trails' ),
'search_items' => __( 'Search Trails', 'he_trails' ),
'not_found' => __( 'Not found in Trails', 'he_trails' ),
'not_found_in_trash' => __( 'Not found in Trash', 'he_trails' ),
);
$args = array(
'label' => __( 'trails', 'he_trails' ),
'description' => __( 'Trails Library: aggregation and summaries of studies', 'he_trails' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'revisions', 'custom-fields', 'page-attributes', ),
'taxonomies' => array( 'region', ' study', ' benefits', ' use' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-palmtree',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'trails', $args );
}
// Hook into the 'init' action
add_action( 'init', 'he_cpt_trails', 0 );
}