Advertisement
Guest User

Untitled

a guest
Apr 15th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2. add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
  3. function your_prefix_register_meta_boxes( $meta_boxes ) {
  4.     $meta_boxes[] = array (
  5.         'title' => 'Prodotti',
  6.       'post_types' =>   array (
  7.         'prodotti',
  8.     ),
  9.       'context' => 'after_title',
  10.       'priority' => 'high',
  11.       'status' => 'publish',
  12.       'autosave' => true,
  13.       'fields' =>   array (
  14.  
  15.         `    array (
  16.       'id' => 'codice_prodotto',
  17.       'type' => 'number',
  18.       'name' => 'Codice prodotto',
  19.       'clone' => 1,
  20.       'required' => 1,
  21.       'sort_clone' => true,
  22.     ),
  23.  
  24.     array (
  25.       'id' => 'unita_di_misura_prodotto',
  26.       'name' => 'Unità di misura',
  27.       'type' => 'select',
  28.       'desc' => 'ore
  29. giornata
  30. quarti di ora
  31. kg
  32. mt
  33. nr
  34. pz',
  35.       'placeholder' => 'Seleziona',
  36.       'options' =>       array (
  37.         'ore' => 'ore',
  38.         'giornata' => 'giornata',
  39.         'quarti di ora' => 'quarti',
  40.         'nr' => 'nr',
  41.         'pz' => 'pz',
  42.       ),
  43.       'required' => 1,
  44.     ),
  45.  
  46.     array (
  47.       'id' => 'categoria_prodotti',
  48.       'type' => 'taxonomy',
  49.       'name' => 'Categoria',
  50.       'taxonomy' => 'categoria_prodotti',
  51.       'field_type' => 'select_tree',
  52.       'required' => 1,
  53.     ),
  54.  
  55.     array (
  56.       'id' => 'prezzo_listino_default_prodotto',
  57.       'type' => 'number',
  58.       'name' => 'Prezzo di Listino',
  59.       'required' => 1,
  60.     ),
  61.  
  62.     array (
  63.       'id' => 'prezzo_listino_rivenditori_prodotto',
  64.       'type' => 'number',
  65.       'name' => 'Prezzo rivenditori',
  66.       'required' => 1,
  67.       'after' => '€',
  68.     ),
  69.  
  70.     array (
  71.       'id' => 'descrizione_breve_prodotto',
  72.       'type' => 'text',
  73.       'name' => 'Descrizione breve',
  74.     ),
  75.   ),
  76.   'id' => 'prodotti',
  77. );
  78.  
  79. return $meta_boxes;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement