Alice Tour – Tour CPT
if ( ! function_exists('custom_post_type') ) {
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Tours', 'Post Type General Name', 'at' ),
'singular_name' => _x( 'Tour', 'Post Type Singular Name', 'at' ),
'menu_name' => __( 'Tours', 'at' ),
'name_admin_bar' => __( 'Tour', 'at' ),
'archives' => __( 'Archivio Tour', 'at' ),
'parent_item_colon' => __( 'Tour superiore:', 'at' ),
'all_items' => __( 'Tutti i tour', 'at' ),
'add_new_item' => __( 'Aggiungi un nuovo Tour', 'at' ),
'add_new' => __( 'Aggiungi nuovo', 'at' ),
'new_item' => __( 'Nuovo Tour', 'at' ),
'edit_item' => __( 'Modifica Tour', 'at' ),
'update_item' => __( 'Aggiorna Tour', 'at' ),
'view_item' => __( 'Vedi Tour', 'at' ),
'search_items' => __( 'Cerca un Tour', 'at' ),
'not_found' => __( 'Non trovato', 'at' ),
'not_found_in_trash' => __( 'Non trovato nel Cestino', 'at' ),
'featured_image' => __( 'Copertina', 'at' ),
'set_featured_image' => __( 'Imposta copertina', 'at' ),
'remove_featured_image' => __( 'Rimuovi copertina', 'at' ),
'use_featured_image' => __( 'Usa come copertina', 'at' ),
'insert_into_item' => __( 'Inserisci nel Tour', 'at' ),
'uploaded_to_this_item' => __( 'Collegati a questo Tour', 'at' ),
'items_list' => __( 'Lista Tour', 'at' ),
'items_list_navigation' => __( 'Navigazione lista Tours', 'at' ),
'filter_items_list' => __( 'Filtra la lista', 'at' ),
);
$rewrite = array(
'slug' => 'tours',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Tour', 'at' ),
'description' => __( 'Un Tour', 'at' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-location-alt',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'tours',
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'tour',
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'tour', $args );
}
add_action( 'init', 'custom_post_type', 0 );
}