Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
- $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',
- ),
- array(
- 'id' => 'gruppo_birra',
- 'type' => 'group',
- 'name' => 'Specifiche birre',
- 'visible' => array(
- 'when' => array(
- array( 'selettore_categoria', 'contains', '2' ),
- array( 'selettore_categoria', 'contains', '1' ),
- ),
- 'relation' => 'or',
- ),
- 'fields' => array(
- array(
- 'id' => 'nome_birra',
- 'type' => 'text',
- 'name' => 'Nome Birra',
- 'desc' => 'Il nome della birra',
- 'placeholder' => 'Nome birra',
- ),
- array(
- 'id' => 'nome_birrificio',
- 'type' => 'text',
- 'name' => 'Nome birrificio',
- 'desc' => 'Inserire il nome del birrificio con l\'iniziale maiuscola',
- 'placeholder' => 'Nome birrificio',
- ),
- array(
- 'id' => 'gradazione',
- 'type' => 'number',
- 'name' => 'Gradazione birra',
- 'desc' => 'Inserire la gradazione senza segni (NO: % e nemmeno: °)',
- 'step' => '0.1',
- ),
- array(
- 'id' => 'stile_birra',
- 'type' => 'text',
- 'name' => 'Stile birra',
- 'desc' => 'Inserire lo stile della birra',
- ),
- array(
- 'id' => 'gusto_prevalente',
- 'name' => 'Gusto prevalente',
- 'type' => 'radio',
- 'desc' => 'Gusto prevalente della birra',
- 'inline' => 1,
- ),
- array(
- 'id' => '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' => 'prezzo_birra',
- 'type' => 'number',
- 'name' => 'Costo birra',
- 'desc' => 'A quanto vendiamo quella birra? Senza simboli',
- 'step' => '0.1',
- ),
- array(
- 'id' => 'disponibilita',
- 'name' => 'Disponibilità',
- 'type' => 'checkbox',
- 'desc' => 'Disponibile o no?',
- 'std' => 1,
- ),
- array(
- 'id' => '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',
- 'fusto' => 'Fusto',
- ),
- 'inline' => 1,
- ),
- array(
- 'id' => 'quantita_birra',
- 'type' => 'text',
- 'name' => 'Quantità birra',
- 'desc' => 'Quante ne hai in magazzino o cella?',
- 'placeholder' => 'Quante ne hai?',
- ),
- array(
- 'id' => 'annata_birra',
- 'type' => 'number',
- 'name' => 'Annata birra',
- 'desc' => 'Di che annate sono le birre che hai?',
- 'clone' => 1,
- 'sort_clone' => true,
- ),
- ),
- ),
- array(
- 'id' => 'gruppo_panini',
- 'type' => 'group',
- 'name' => 'Specifiche panini',
- 'visible' => array(
- 'when' => array(
- array( 'selettore_categoria', 'contains', '4' ),
- array( 'selettore_categoria', 'contains', '5' ),
- ),
- 'relation' => 'or',
- ),
- 'fields' => array(
- array(
- 'id' => 'link_youtube',
- 'type' => 'oembed',
- 'name' => 'Link YouTube',
- 'desc' => 'Link alla canzone',
- ),
- array(
- 'id' => 'img_low_res',
- 'type' => 'single_image',
- 'name' => 'Immagine a bassa qualità',
- 'desc' => 'Carica qui l\'immagine a bassa qualità',
- ),
- array(
- 'id' => 'img_high_res',
- 'type' => 'single_image',
- 'name' => 'Immagine alta qualità',
- 'desc' => 'Carica qui l\'immagine ad alta qualità',
- ),
- ),
- ),
- ),
- );
- return $meta_boxes;
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement