choices ) ) { return; } $name = $this->id; $value = $this->value(); ?> label ) ) : ?> label ); ?> description ) ) : ?> description; ?> '; foreach ( $this->choices as $list_key => $list_value ) { $selected = ''; if ( $list_key == $value ) { $selected = ' class="cpotheme-imagelist-selected"'; } $output .= ''; } $output .= ''; echo $output; } } class Antreas_Customize_Collection_Control extends WP_Customize_Control { public function render_content() { if ( empty( $this->choices ) ) { return; } $name = $this->id; $value = $this->value(); ?> label ) ) : ?> label ); ?> description ) ) : ?> description; ?> '; foreach ( $value as $current_key => $current_value ) { $counter++; $output .= '
'; foreach ( $this->choices as $list_key => $list_value ) { //Save field data-- collections can be of any field type $field_name = '[' . $current_key . '][' . $list_key . ']'; $field_type = isset( $list_value['type'] ) ? $list_value['type'] : 'text'; $field_width = isset( $list_value['width'] ) ? $list_value['width'] : '100'; $field_args = isset( $list_value['args'] ) ? $list_value['args'] : null; $field_options = isset( $list_value['option'] ) ? $list_value['option'] : null; $field_value = isset( $current_value[ $list_key ] ) ? $current_value[ $list_key ] : ''; $output .= '
'; //Display corresponding type of field if ( $field_type == 'text' ) { if ( isset( $field_args['placeholder'] ) ) { $field_placeholder = ' placeholder="' . $field_args['placeholder'] . '"'; } else { $field_placeholder = ''; } $output .= ''; } elseif ( $field_type == 'select' ) { $field_class = ( isset( $field_args['class'] ) ? $field_args['class'] : '' ); $output .= ''; } $output .= '
'; } $output .= '' . __( 'Remove', 'antreas' ) . ''; $output .= '
'; } $output .= '
'; $output .= '' . __( 'Add Row', 'antreas' ) . ''; $output .= '
'; $output .= ''; echo $output; } }