fields = $fields; $this->box_label = isset($args['box_label']) ? $args['box_label'] : ''; $this->add_label = isset($args['add_label']) ? $args['add_label'] : ''; $this->cats = get_categories(array('hide_empty' => false)); parent::__construct($manager, $id, $args); } public function render_content() { ?> label); ?> description) { ?> description); ?> link()); ?> class="ms-repeater-collector" value="value()); ?>" /> fields; $values = json_decode($this->value()); if (is_array($values)) { foreach ($values as $value) { ?>
  • box_label); ?>

    $field) { $class = isset($field['class']) ? $field['class'] : ''; ?>
    $key) ? $value->$key : ''; $default = isset($field['default']) ? $field['default'] : ''; switch ($field['type']) { case 'text': echo ''; break; case 'textarea': echo ''; break; case 'upload': $image = $image_class = ""; if ($new_value) { $image = ''; $image_class = ' hidden'; } echo '
    '; echo '
    '; echo '
    '; esc_html_e('No image selected', 'bigmart'); echo '
    '; echo '
    '; echo $image; echo '
    '; echo '
    '; echo ''; echo ''; echo ''; echo '
    '; echo '
    '; echo '
    '; break; case 'category': echo ''; break; case 'select': $options = $field['options']; echo ''; break; case 'toggle': $checkbox_class = ($new_value == 'yes') ? 'ms-toggle-on' : ''; echo '
    '; echo ''; echo '
    '; if (!empty($label)) { echo '' . esc_html($label) . ''; } if (!empty($description)) { echo '' . esc_html($description) . ''; } break; case 'colorpicker': echo ''; break; case 'selector': $options = $field['options']; echo '
    '; foreach ($options as $option => $val) { $class = ( $new_value == $option ) ? 'selector-selected' : ''; echo ''; } echo '
    '; echo ''; break; case 'radio': $options = $field['options']; echo '
    '; foreach ($options as $option => $val) { echo ''; } echo '
    '; echo ''; break; case 'switch': $switch = $field['switch']; $switch_class = ($new_value == 'on') ? 'switch-on' : ''; echo '
    '; echo '
    '; echo '
    '; echo '
    ' . esc_html($switch["on"]) . '
    '; echo '
    '; echo '
    '; echo '
    ' . esc_html($switch["off"]) . '
    '; echo '
    '; echo '
    '; echo '
    '; echo ''; break; case 'range': $options = $field['options']; $new_value = $new_value ? $new_value : $options['val']; echo '
    '; echo '
    '; echo ''; echo '' . esc_html($options['unit']) . ''; echo '
    '; break; case 'icon': echo '
    '; echo '
    '; echo ''; echo ''; echo '
    '; echo '
    '; echo ''; if (apply_filters('bigmart_show_ico_font', true)) { echo '
      '; $bigmart_icofont_icon_array = bigmart_icofont_icon_array(); foreach ($bigmart_icofont_icon_array as $bigmart_icofont_icon) { $icon_class = $new_value == $bigmart_icofont_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; } if (apply_filters('bigmart_show_material_icon', true)) { echo '
      '; $bigmart_materialdesignicons_icon_array = bigmart_materialdesignicons_array(); foreach ($bigmart_materialdesignicons_icon_array as $bigmart_materialdesignicons_icon) { $icon_class = $new_value == $bigmart_materialdesignicons_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; } if (apply_filters('bigmart_show_elegant_icon', true)) { echo '
      '; $bigmart_eleganticons_icon_array = bigmart_eleganticons_array(); foreach ($bigmart_eleganticons_icon_array as $bigmart_eleganticons_icon) { $icon_class = $new_value == $bigmart_eleganticons_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; } echo '
    '; echo ''; echo '
    '; break; case 'multicategory': $new_value_array = !is_array($new_value) ? explode(',', $new_value) : $new_value; echo '
      '; foreach ($this->cats as $cat) { $checked = in_array($cat->term_id, $new_value_array) ? 'checked="checked"' : ''; echo '
    • '; echo ''; echo '
    • '; } echo '
    '; echo ''; break; default: break; } ?>