public function render_content($vals = null) { do_action(self::$type_slug . '_before_render_content', $this); if ($vals != null) { $this->field = (object) $vals; } $this->get_value(); $section = isset($this->page->section) && $this->page->section != '' ? 'data-section="' . esc_attr($this->page->section) . '"' : ''; if (isset($this->field->repeating) && $this->field->repeating == 'Yes') { ?> <label> <span class="customize-control-title"><?php echo $this->field->title; ?> </span> <div class="customize-control-content"> <?php if (isset($this->field->value) && is_array($this->field->value)) { foreach ($this->field->value as $key => $tmp_value) { if (is_string($key)) { unset($this->field->value[$key]); } } } $count = isset($this->field->value) ? count((array) $this->field->value) : 1; if ($count == 0) { $count = 1; } for ($key = 0; $key < $count; $key++) { if (isset($this->field->value) && is_array($this->field->value)) { $repeat_value = isset($this->field->value[$key]) ? $this->field->value[$key] : ''; } else { $repeat_value = ''; } ?> <input type="text" class="input-text custom-data-type" <?php echo $section; // escaped above ?> data-type="input-text" <?php echo parent::add_data_conditional_display($this->field); ?> <?php $this->link(); ?> name="<?php echo esc_attr($this->field->alias); ?> []" accept=""value="<?php echo isset($repeat_value) && $repeat_value != '' ? esc_attr($repeat_value) : ''; ?> " /> <a href="#" class="delete_field"><?php echo __('Delete', 'framework'); ?> </a><br> <?php } if (isset($this->field->repeating) && $this->field->repeating == 'Yes') { $field = array('field_name' => $this->field->alias, 'type' => 'text', 'class' => 'input-text custom-data-type', 'data_section' => isset($this->page->section) ? $this->page->section : '', 'data_type' => 'input-text', 'after_field' => '', 'value' => 'aaa'); $field = parent::add_data_conditional_display_repeating($field, $this->field); $this->enable_repeating($field); } ?> </div> </label> <?php $this->wp_customize_js(); } else { ?> <label> <span class="customize-control-title"><?php echo $this->field->title; ?> </span> <?php $input_value = $vals != null ? $this->field->saved : $this->get_value(); if (!is_string($input_value) && !is_numeric($input_value)) { if (is_array($input_value) && isset($input_value[0])) { $input_value = $input_value[0]; } else { $input_value = ""; } } ?> <div class="customize-control-content"> <input type="text" class="input-text custom-data-type" <?php echo $section; // escaped above ?> data-type="input-text" <?php echo parent::add_data_conditional_display($this->field); // escaped above ?> <?php $this->link(); ?> name="<?php echo esc_attr($this->field->alias); ?> " value="<?php echo esc_attr($input_value); ?> "/> </div> </label> <?php } do_action(self::$type_slug . '_after_render_content', $this); }