Prodotti CPT
// Register Custom Post Type
function prodotti_post_type() {
$labels = array(
'name' => _x( 'Prodotti', 'Post Type General Name', 'cap' ),
'singular_name' => _x( 'Prodotto', 'Post Type Singular Name', 'cap' ),
'menu_name' => __( 'Prodotti', 'cap' ),
'name_admin_bar' => __( 'Prodotti', 'cap' ),
'archives' => __( 'Archivio prodotti', 'cap' ),
'attributes' => __( 'Item Attributes', 'cap' ),
'parent_item_colon' => __( 'Prodotto genitore', 'cap' ),
'all_items' => __( 'Tutti i prodotti', 'cap' ),
'add_new_item' => __( 'Aggiungi nuovo prodotto', 'cap' ),
'add_new' => __( 'Aggiungi nuovo', 'cap' ),
'new_item' => __( 'Aggiungi prodotto', 'cap' ),
'edit_item' => __( 'Modifica prodotto', 'cap' ),
'update_item' => __( 'Aggiorna prodotto', 'cap' ),
'view_item' => __( 'Visualizza prodotto', 'cap' ),
'view_items' => __( 'View Items', 'cap' ),
'search_items' => __( 'Cerca prodotto', 'cap' ),
'not_found' => __( 'Non trovato', 'cap' ),
'not_found_in_trash' => __( 'Non trovato nel cestino', 'cap' ),
'featured_image' => __( 'Immagine prodotto', 'cap' ),
'set_featured_image' => __( 'Imposta immagine prodotto', 'cap' ),
'remove_featured_image' => __( 'Rimuovi immagine prodotto', 'cap' ),
'use_featured_image' => __( 'Usa come immagine prodotto', 'cap' ),
'insert_into_item' => __( 'Inserisci nel prodotto', 'cap' ),
'uploaded_to_this_item' => __( 'Carica in questo prodotto', 'cap' ),
'items_list' => __( 'Lista prodotti', 'cap' ),
'items_list_navigation' => __( 'Menu lista prodotti', 'cap' ),
'filter_items_list' => __( 'Filtra lista prodotti', 'cap' ),
);
$rewrite = array(
'slug' => 'prodotti',
'with_front' => false,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Prodotto', 'cap' ),
'description' => __( 'I prodotti CAP Arreghini', 'cap' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-appearance',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'prodotti', $args );
}
add_action( 'init', 'prodotti_post_type', 0 );