Custom Luoghi
// Register Custom Post Type
function custom_location_type() {
$labels = array(
'name' => _x( 'Luoghi', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Luogo', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Luoghi', 'text_domain' ),
'name_admin_bar' => __( 'Luogo', 'text_domain' ),
'archives' => __( 'Archivio Luoghi', 'text_domain' ),
'parent_item_colon' => __( 'Luogo Parente:', 'text_domain' ),
'all_items' => __( 'Tutti i Luoghi', 'text_domain' ),
'add_new_item' => __( 'Aggiungi Nuovo Luogo', 'text_domain' ),
'add_new' => __( 'Aggiungi Luogo', 'text_domain' ),
'new_item' => __( 'Nuovo Luogo', 'text_domain' ),
'edit_item' => __( 'Modifica Luogo', 'text_domain' ),
'update_item' => __( 'Aggiorna Luogo', 'text_domain' ),
'view_item' => __( 'Visualizza Luogo', 'text_domain' ),
'search_items' => __( 'Cerca Luogo', 'text_domain' ),
'not_found' => __( 'Non Trovato', 'text_domain' ),
'not_found_in_trash' => __( 'Non Trovato nel Cestino', 'text_domain' ),
'featured_image' => __( 'Immagine di Copertina', 'text_domain' ),
'set_featured_image' => __( 'Imposta Immagine di Copertina', 'text_domain' ),
'remove_featured_image' => __( 'Rimuovi Immagine di Copertina', 'text_domain' ),
'use_featured_image' => __( 'Usa come Immagine di Copertina', 'text_domain' ),
'insert_into_item' => __( 'Inserisci nel Luogo', 'text_domain' ),
'uploaded_to_this_item' => __( 'Carica nel Luogo', 'text_domain' ),
'items_list' => __( 'Lista Luoghi', 'text_domain' ),
'items_list_navigation' => __( 'Menu Lista Luoghi', 'text_domain' ),
'filter_items_list' => __( 'Filtra Luoghi', 'text_domain' ),
);
$args = array(
'label' => __( 'Luogo', 'text_domain' ),
'description' => __( 'Un luogo dove si tiene un evento', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 10,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'luoghi',
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'location', $args );
}
add_action( 'init', 'custom_location_type', 0 );