Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.93 KB | None | 0 0
  1. <?php
  2. add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
  3.     $meta_boxes[] = array(
  4.         'id'         => 'configuratore-spine',
  5.         'title'      => 'Configuratore post',
  6.         'post_types' => 'post',
  7.         'context'    => 'normal',
  8.         'fields'     => array(
  9.             array(
  10.                 'id'          => 'selettore_categoria',
  11.                 'type'        => 'taxonomy',
  12.                 'name'        => 'Selezione categoria',
  13.                 'desc'        => 'Scegli in quale categoria salvare il post',
  14.                 'placeholder' => 'Scegli la categoria',
  15.                 'taxonomy'    => 'category',
  16.                 'field_type'  => 'checkbox_tree',
  17.             ),
  18.             array(
  19.                 'id'      => 'gruppo_birra',
  20.                 'type'    => 'group',
  21.                 'name'    => 'Specifiche birre',
  22.                 'visible' => array(
  23.                     'when'     => array(
  24.                         array( 'selettore_categoria', 'contains', '2' ),
  25.                         array( 'selettore_categoria', 'contains', '1' ),
  26.                     ),
  27.                     'relation' => 'or',
  28.                 ),
  29.                 'fields'  => array(
  30.                     array(
  31.                         'id'          => 'nome_birra',
  32.                         'type'        => 'text',
  33.                         'name'        => 'Nome Birra',
  34.                         'desc'        => 'Il nome della birra',
  35.                         'placeholder' => 'Nome birra',
  36.                     ),
  37.                     array(
  38.                         'id'          => 'nome_birrificio',
  39.                         'type'        => 'text',
  40.                         'name'        => 'Nome birrificio',
  41.                         'desc'        => 'Inserire il nome del birrificio con l\'iniziale maiuscola',
  42.                         'placeholder' => 'Nome birrificio',
  43.                     ),
  44.                     array(
  45.                         'id'   => 'gradazione',
  46.                         'type' => 'number',
  47.                         'name' => 'Gradazione birra',
  48.                         'desc' => 'Inserire la gradazione senza segni (NO: % e nemmeno: °)',
  49.                         'step' => '0.1',
  50.                     ),
  51.                     array(
  52.                         'id'   => 'stile_birra',
  53.                         'type' => 'text',
  54.                         'name' => 'Stile birra',
  55.                         'desc' => 'Inserire lo stile della birra',
  56.                     ),
  57.                     array(
  58.                         'id'     => 'gusto_prevalente',
  59.                         'name'   => 'Gusto prevalente',
  60.                         'type'   => 'radio',
  61.                         'desc'   => 'Gusto prevalente della birra',
  62.                         'inline' => 1,
  63.                     ),
  64.                     array(
  65.                         'id'      => 'gusto_descrittori',
  66.                         'name'    => 'Scegli i descrittori della birra',
  67.                         'type'    => 'checkbox_list',
  68.                         'desc'    => 'La lista dei descrittori presa da qui: https://www.pintamedicea.com/birra/2017/la-ruota-dei-sapori-di-meilgaard/',
  69.                         'options' => array(
  70.                             'fruttato'    => 'Fruttato',
  71.                             'floreale'    => 'Floreale',
  72.                             'luppolato'   => 'Luppolato',
  73.                             'resinoso'    => 'Resinoso',
  74.                             'alcolico'    => 'Alcolico/Solvente',
  75.                             'malto'       => 'Malto',
  76.                             'caramello'   => 'Caramello',
  77.                             'tostato'     => 'Tostato/Bruciato',
  78.                             'acido'       => 'Acido',
  79.                             'dolce'       => 'Dolce',
  80.                             'amaro'       => 'Amaro',
  81.                             'astringente' => 'Astringente',
  82.                         ),
  83.                         'inline'  => 1,
  84.                     ),
  85.                     array(
  86.                         'id'   => 'prezzo_birra',
  87.                         'type' => 'number',
  88.                         'name' => 'Costo birra',
  89.                         'desc' => 'A quanto vendiamo quella birra? Senza simboli',
  90.                         'step' => '0.1',
  91.                     ),
  92.                     array(
  93.                         'id'   => 'disponibilita',
  94.                         'name' => 'Disponibilità',
  95.                         'type' => 'checkbox',
  96.                         'desc' => 'Disponibile o no?',
  97.                         'std'  => 1,
  98.                     ),
  99.                     array(
  100.                         'id'      => 'formato_birra',
  101.                         'name'    => 'Formati disponibili',
  102.                         'type'    => 'checkbox_list',
  103.                         'desc'    => 'Che formati sono disponibili?',
  104.                         'options' => array(
  105.                             '33cl'   => '33cl',
  106.                             '375cl'  => '37.5cl',
  107.                             '50cl'   => '50cl',
  108.                             '75cl'   => '75cl',
  109.                             'magnum' => 'Magnum',
  110.                             'fusto'  => 'Fusto',
  111.                         ),
  112.                         'inline'  => 1,
  113.                     ),
  114.                     array(
  115.                         'id'          => 'quantita_birra',
  116.                         'type'        => 'text',
  117.                         'name'        => 'Quantità birra',
  118.                         'desc'        => 'Quante ne hai in magazzino o cella?',
  119.                         'placeholder' => 'Quante ne hai?',
  120.                     ),
  121.                     array(
  122.                         'id'         => 'annata_birra',
  123.                         'type'       => 'number',
  124.                         'name'       => 'Annata birra',
  125.                         'desc'       => 'Di che annate sono le birre che hai?',
  126.                         'clone'      => 1,
  127.                         'sort_clone' => true,
  128.                     ),
  129.                 ),
  130.             ),
  131.             array(
  132.                 'id'      => 'gruppo_panini',
  133.                 'type'    => 'group',
  134.                 'name'    => 'Specifiche panini',
  135.                 'visible' => array(
  136.                     'when'     => array(
  137.                         array( 'selettore_categoria', 'contains', '4' ),
  138.                         array( 'selettore_categoria', 'contains', '5' ),
  139.                     ),
  140.                     'relation' => 'or',
  141.                 ),
  142.                 'fields'  => array(
  143.                     array(
  144.                         'id'   => 'link_youtube',
  145.                         'type' => 'oembed',
  146.                         'name' => 'Link YouTube',
  147.                         'desc' => 'Link alla canzone',
  148.                     ),
  149.                     array(
  150.                         'id'   => 'img_low_res',
  151.                         'type' => 'single_image',
  152.                         'name' => 'Immagine a bassa qualità',
  153.                         'desc' => 'Carica qui l\'immagine a bassa qualità',
  154.                     ),
  155.                     array(
  156.                         'id'   => 'img_high_res',
  157.                         'type' => 'single_image',
  158.                         'name' => 'Immagine alta qualità',
  159.                         'desc' => 'Carica qui l\'immagine ad alta qualità',
  160.                     ),
  161.                 ),
  162.             ),
  163.         ),
  164.     );
  165.  
  166.     return $meta_boxes;
  167. } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement