Ejemplo n.º 1
0
  */
 //repeater block
 $my_meta2->addRepeaterBlock($prefix . 're_', array('inline' => true, 'name' => 'This is a Repeater Block', 'fields' => $repeater_fields, 'sortable' => true));
 /*
  * To Create a conditinal Block first create an array of fields
  * use the same functions as above but add true as a last param (like the repater block)
  */
 $Conditinal_fields[] = $my_meta2->addText($prefix . 'con_text_field_id', array('name' => 'My Text '), true);
 $Conditinal_fields[] = $my_meta2->addTextarea($prefix . 'con_textarea_field_id', array('name' => 'My Textarea '), true);
 $Conditinal_fields[] = $my_meta2->addCheckbox($prefix . 'con_checkbox_field_id', array('name' => 'My Checkbox '), true);
 $Conditinal_fields[] = $my_meta2->addColor($prefix . 'con_color_field_id', array('name' => 'My color '), true);
 /*
  * Then just add the fields to the repeater block
  */
 //repeater block
 $my_meta2->addCondition('conditinal_fields', array('name' => __('Enable conditinal fields? ', 'mmb'), 'desc' => __('<small>Turn ON if you want to enable the <strong>conditinal fields</strong>.</small>', 'mmb'), 'fields' => $Conditinal_fields, 'std' => false));
 /*
  * Don't Forget to Close up the meta box Declaration 
  */
 //Finish Meta Box Declaration
 $my_meta2->Finish();
 $prefix = "_groupped_";
 $config3 = array('id' => 'demo_meta_box3', 'title' => 'Groupped Meta Box fields', 'pages' => array('post', 'page'), 'context' => 'normal', 'priority' => 'low', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
 /*
  * Initiate your 3rd meta box
  */
 $my_meta3 = new AT_Meta_Box($config3);
 //first field of the group has 'group' => 'start' and last field has 'group' => 'end'
 //text field
 $my_meta3->addText($prefix . 'text_field_id', array('name' => 'My Text ', 'group' => 'start'));
 //textarea field