TH Audiowalks – CPT – Stations
if ( ! function_exists('thauwa_stations_cpt') ) {
// Register Custom Post Type
function thauwa_stations_cpt() {
$labels = array(
'name' => _x( 'Stations', 'Post Type General Name', 'thauwa_text_domain' ),
'singular_name' => _x( 'Station', 'Post Type Singular Name', 'thauwa_text_domain' ),
'menu_name' => __( 'Stations', 'thauwa_text_domain' ),
'name_admin_bar' => __( 'Stations', 'thauwa_text_domain' ),
'archives' => __( 'Station Archives', 'thauwa_text_domain' ),
'attributes' => __( 'Station Attributes', 'thauwa_text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'thauwa_text_domain' ),
'all_items' => __( 'All Stations', 'thauwa_text_domain' ),
'add_new_item' => __( 'Add New Station', 'thauwa_text_domain' ),
'add_new' => __( 'Add New', 'thauwa_text_domain' ),
'new_item' => __( 'New Station', 'thauwa_text_domain' ),
'edit_item' => __( 'Edit Station', 'thauwa_text_domain' ),
'update_item' => __( 'Update Station', 'thauwa_text_domain' ),
'view_item' => __( 'View Station', 'thauwa_text_domain' ),
'view_items' => __( 'View Stations', 'thauwa_text_domain' ),
'search_items' => __( 'Search Station', 'thauwa_text_domain' ),
'not_found' => __( 'Not found', 'thauwa_text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'thauwa_text_domain' ),
'featured_image' => __( 'Featured Image', 'thauwa_text_domain' ),
'set_featured_image' => __( 'Set featured image', 'thauwa_text_domain' ),
'remove_featured_image' => __( 'Remove featured image', 'thauwa_text_domain' ),
'use_featured_image' => __( 'Use as featured image', 'thauwa_text_domain' ),
'insert_into_item' => __( 'Insert into Station', 'thauwa_text_domain' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'thauwa_text_domain' ),
'items_list' => __( 'Stations list', 'thauwa_text_domain' ),
'items_list_navigation' => __( 'Stations list navigation', 'thauwa_text_domain' ),
'filter_items_list' => __( 'Filter Stations list', 'thauwa_text_domain' ),
);
$args = array(
'label' => __( 'Station', 'thauwa_text_domain' ),
'description' => __( 'The stations of the Trans.History Audiowlaks', 'thauwa_text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'post-formats' ),
'taxonomies' => array( 'city' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-location',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'station', $args );
}
add_action( 'init', 'thauwa_stations_cpt', 0 );
}