Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * MetaBox personalizzati
- */
- add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
- $prefix = 'et2018-';
- $meta_boxes[] = array(
- 'id' => 'configuratore-spine',
- 'title' => 'Configuratore post',
- 'post_types' => 'post',
- 'context' => 'normal',
- 'fields' => array(
- array(
- 'id' =>'selettore_categoria',
- 'type' => 'taxonomy',
- 'name' => 'Selezione categoria',
- 'desc' => 'Scegli in quale categoria salvare il post',
- 'placeholder' => 'Scegli la categoria',
- 'taxonomy' => 'category',
- 'field_type' => 'checkbox_tree',
- ),
- /* Gruppo Birra */
- array(
- 'id' => 'gruppo_birra',
- 'type' => 'group',
- 'name' => 'Specifiche birre',
- 'visible' => array(
- 'when' => array(
- array( 'selettore_categoria', 'contains', '2' ),
- //array( 'selettore_categoria', 'contains', '28' ),
- ),
- 'relation' => 'or',
- ),
- 'fields' => array(
- array(
- 'id' => $prefix.'nome_birra',
- 'type' => 'text',
- 'name' => 'Nome Birra',
- 'desc' => 'Il nome della birra',
- 'placeholder' => 'Nome birra',
- ),
- array(
- 'id' => $prefix.'nome_birrificio',
- 'type' => 'text',
- 'name' => 'Nome birrificio',
- 'desc' => "Inserire il nome del birrificio con l'iniziale maiuscola",
- 'placeholder' => 'Nome birrificio',
- ),
- array(
- 'id' => $prefix.'gradazione',
- 'type' => 'number',
- 'name' => 'Gradazione birra',
- 'desc' => 'Inserire la gradazione senza segni (NO: % e nemmeno: °)',
- 'step' => '0.1',
- ),
- array(
- 'id' => $prefix.'stile_birra',
- 'type' => 'text',
- 'name' => 'Stile birra',
- 'desc' => 'Inserire lo stile della birra',
- ),
- array(
- 'id' => $prefix.'gusto_prevalente',
- 'name' => 'Gusto prevalente',
- 'type' => 'radio',
- 'desc' => 'Gusto prevalente della birra',
- 'options' => array(
- 'amaro' => 'Amaro',
- 'dolce' => 'Dolce',
- 'acido' => 'Acido',
- 'tostato' => 'Tostato',
- ),
- 'inline' => true,
- ),
- array(
- 'id' => $prefix.'gusto_descrittori',
- 'name' => 'Scegli i descrittori della birra',
- 'type' => 'checkbox_list',
- 'desc' => 'La lista dei descrittori presa da qui: https://www.pintamedicea.com/birra/2017/la-ruota-dei-sapori-di-meilgaard/',
- 'options' => array(
- 'fruttato' => 'Fruttato',
- 'floreale' => 'Floreale',
- 'luppolato' => 'Luppolato',
- 'resinoso' => 'Resinoso',
- 'alcolico' => 'Alcolico/Solvente',
- 'malto' => 'Malto',
- 'caramello' => 'Caramello',
- 'tostato' => 'Tostato/Bruciato',
- 'acido' => 'Acido',
- 'dolce' => 'Dolce',
- 'amaro' => 'Amaro',
- 'astringente' => 'Astringente',
- ),
- 'inline' => 1,
- ),
- array(
- 'id' => $prefix.'prezzo_birra',
- 'type' => 'text',
- 'name' => 'Costo birra',
- 'desc' => 'A quanto vendiamo quella birra? Senza simboli',
- 'clone' => 1,
- 'sort_clone' => true,
- 'step' => '0.1',
- ),
- array(
- 'id' => $prefix.'disponibilita',
- 'name' => 'Disponibilità',
- 'type' => 'checkbox',
- 'desc' => 'Disponibile o no?',
- 'std' => 1,
- ),
- array(
- 'id' => $prefix.'formato_birra',
- 'name' => 'Formati disponibili',
- 'type' => 'checkbox_list',
- 'desc' => 'Che formati sono disponibili?',
- 'options' => array(
- '33cl' => '33cl',
- '375cl' => '37.5cl',
- '50cl' => '50cl',
- '75cl' => '75cl',
- 'magnum' => 'Magnum',
- 'bgb' => 'BGB',
- 'fusto' => 'Fusto',
- ),
- 'inline' => 1,
- ),
- array(
- 'id' => $prefix.'quantita_birra',
- 'type' => 'text',
- 'name' => 'Quantità birra',
- 'desc' => 'Quante ne hai in magazzino o cella?',
- 'placeholder' => 'Quante ne hai?',
- ),
- array(
- 'id' => $prefix.'annata_birra',
- 'type' => 'number',
- 'name' => 'Annata birra',
- 'desc' => 'Di che annate sono le birre che hai?',
- 'clone' => 1,
- 'sort_clone' => true,
- ),
- ),
- ),
- /* Gruppo Panini */
- array(
- 'id' => 'gruppo_panini',
- 'type' => 'group',
- 'name' => 'Specifiche panini',
- 'visible' => array(
- 'when' => array(
- array( 'selettore_categoria', 'contains', '36' ),
- //array( 'selettore_categoria', 'contains', '5' ),
- ),
- 'relation' => 'or',
- ),
- 'fields' => array(
- array(
- 'id' => $prefix.'link_youtube',
- 'type' => 'text',
- 'name' => 'Link YouTube',
- 'desc' => 'Link alla canzone',
- ),
- array(
- 'id' => $prefix.'img_low_res',
- 'type' => 'single_image',
- 'name' => 'Immagine a bassa qualità',
- 'desc' => 'Carica qui l\'immagine a bassa qualità',
- ),
- array(
- 'id' => $prefix.'img_high_res',
- 'type' => 'single_image',
- 'name' => 'Immagine alta qualità',
- 'desc' => 'Carica qui l\'immagine ad alta qualità',
- ),
- array(
- 'id' => $prefix . 'descrizione',
- 'type' => 'textarea',
- 'name' => esc_html__( 'Descrizione pietanza', 'et-2018-template' ),
- ),
- array(
- 'id' => $prefix.'costo',
- 'type' => 'number',
- 'name' => 'Costo pietanza',
- 'desc' => 'A quanto vendiamo quel piatto?',
- 'step' => '0.1',
- ),
- array(
- 'id' => $prefix.'versionemini',
- 'name' => 'Versione mini',
- 'type' => 'checkbox',
- 'desc' => 'Disponibile o no?',
- 'std' => 0,
- ),
- ),
- ),
- /* Gruppo Cantina */
- array(
- 'id' => 'gruppo_cantina',
- 'type' => 'group',
- 'name' => 'Specifiche birre',
- 'visible' => array(
- 'when' => array(
- //array( 'selettore_categoria', 'contains', '2' ),
- array( 'selettore_categoria', 'contains', '28' ),
- ),
- 'relation' => 'or',
- ),
- 'fields' => array(
- array(
- 'id' => $prefix.'nome_birra',
- 'type' => 'text',
- 'name' => 'Nome Birra',
- 'desc' => 'Il nome della birra',
- 'placeholder' => 'Nome birra',
- ),
- array(
- 'id' => $prefix.'nome_birrificio',
- 'type' => 'text',
- 'name' => 'Nome birrificio',
- 'desc' => "Inserire il nome del birrificio con l'iniziale maiuscola",
- 'placeholder' => 'Nome birrificio',
- ),
- array(
- 'id' => $prefix.'gradazione',
- 'type' => 'number',
- 'name' => 'Gradazione birra',
- 'desc' => 'Inserire la gradazione senza segni (NO: % e nemmeno: °)',
- 'step' => '0.1',
- ),
- array(
- 'id' => $prefix.'stile_birra',
- 'type' => 'text',
- 'name' => 'Stile birra',
- 'desc' => 'Inserire lo stile della birra',
- ),
- array(
- 'id' => $prefix.'gusto_prevalente',
- 'name' => 'Gusto prevalente',
- 'type' => 'radio',
- 'desc' => 'Gusto prevalente della birra',
- 'options' => array(
- 'amaro' => 'Amaro',
- 'dolce' => 'Dolce',
- 'acido' => 'Acido',
- 'tostato' => 'Tostato',
- ),
- 'inline' => true,
- ),
- array(
- 'id' => $prefix.'gusto_descrittori',
- 'name' => 'Scegli i descrittori della birra',
- 'type' => 'checkbox_list',
- 'desc' => 'La lista dei descrittori presa da qui: https://www.pintamedicea.com/birra/2017/la-ruota-dei-sapori-di-meilgaard/',
- 'options' => array(
- 'fruttato' => 'Fruttato',
- 'floreale' => 'Floreale',
- 'luppolato' => 'Luppolato',
- 'resinoso' => 'Resinoso',
- 'alcolico' => 'Alcolico/Solvente',
- 'malto' => 'Malto',
- 'caramello' => 'Caramello',
- 'tostato' => 'Tostato/Bruciato',
- 'acido' => 'Acido',
- 'dolce' => 'Dolce',
- 'amaro' => 'Amaro',
- 'astringente' => 'Astringente',
- ),
- 'inline' => 1,
- ),
- array(
- 'id' => $prefix.'prezzo_birra',
- 'type' => 'text',
- 'name' => 'Costo birra',
- 'desc' => 'A quanto vendiamo quella birra? Senza simboli',
- 'clone' => 1,
- 'sort_clone' => true,
- 'step' => '0.1',
- ),
- array(
- 'id' => $prefix.'disponibilita',
- 'name' => 'Disponibilità',
- 'type' => 'checkbox',
- 'desc' => 'Disponibile o no?',
- 'std' => 1,
- ),
- array(
- 'id' => $prefix.'formato_birra',
- 'name' => 'Formati disponibili',
- 'type' => 'checkbox_list',
- 'desc' => 'Che formati sono disponibili?',
- 'options' => array(
- '33cl' => '33cl',
- '375cl' => '37.5cl',
- '50cl' => '50cl',
- '75cl' => '75cl',
- 'magnum' => 'Magnum',
- 'bgb' => 'BGB',
- 'fusto' => 'Fusto',
- ),
- 'inline' => 1,
- ),
- array(
- 'id' => $prefix.'quantita_birra',
- 'type' => 'text',
- 'name' => 'Quantità birra',
- 'desc' => 'Quante ne hai in magazzino o cella?',
- 'placeholder' => 'Quante ne hai?',
- 'clone' => 1,
- 'sort_clone' => true,
- 'step' => '0.1',
- 'admin_columns' => 'after title',
- ),
- array(
- 'id' => $prefix.'annata_birra',
- 'type' => 'number',
- 'name' => 'Annata birra',
- 'desc' => 'Di che annate sono le birre che hai?',
- 'clone' => 1,
- 'sort_clone' => true,
- ),
- array(
- 'id' => $prefix.'img_low_res',
- 'type' => 'single_image',
- 'name' => 'Immagine a bassa qualità',
- 'desc' => 'Carica qui l\'immagine a bassa qualità',
- ),
- array(
- 'id' => $prefix.'img_high_res',
- 'type' => 'single_image',
- 'name' => 'Immagine alta qualità',
- 'desc' => 'Carica qui l\'immagine ad alta qualità',
- ),
- array(
- 'id' => $prefix . 'descrizione',
- 'type' => 'textarea',
- 'name' => esc_html__( 'Descrizione birra', 'et-2018-template' ),
- ),
- ),
- ),
- ),
- );
- return $meta_boxes;
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement