예제 #1
0
 */
//repeater block
$options_panel->addRepeaterBlock('re_', array('sortable' => true, 'inline' => true, 'name' => __('This is a Repeater Block', 'apc'), 'fields' => $repeater_fields, 'desc' => __('Repeater field description', 'apc')));
/**
 * To Create a Conditional Block first create an array of fields (just like a repeater block
 * use the same functions as above but add true as a last param
 */
$Conditinal_fields[] = $options_panel->addText('con_text_field_id', array('name' => __('My Text ', 'apc')), true);
$Conditinal_fields[] = $options_panel->addTextarea('con_textarea_field_id', array('name' => __('My Textarea ', 'apc')), true);
$Conditinal_fields[] = $options_panel->addImage('con_image_field_id', array('name' => __('My Image ', 'apc')), true);
$Conditinal_fields[] = $options_panel->addCheckbox('con_checkbox_field_id', array('name' => __('My Checkbox  ', 'apc')), true);
/**
 * Then just add the fields to the repeater block
 */
//conditinal block
$options_panel->addCondition('conditinal_fields', array('name' => __('Enable conditinal fields? ', 'apc'), 'desc' => __('<small>Turn ON if you want to enable the <strong>conditinal fields</strong>.</small>', 'apc'), 'fields' => $Conditinal_fields, 'std' => false));
/**
 * Close 5th tab
 */
$options_panel->CloseTab();
/**
 * Open admin page 6th tab
 * field validation 
 * `email`            => validate email
 * `alphanumeric`     => validate alphanumeric
 * `url`              => validate url
 * `length`           => check for string length
 * `maxlength`        => check for max string length
 * `minlength`        => check for min string length
 * `maxvalue`         => check for max numeric value
 * `minvalue`         => check for min numeric value