| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped,WordPress.Security.EscapeOutput.ExceptionNotEscaped,WordPress.Security.EscapeOutput.UnsafePrintingFunction -- Legacy Customify view output contains trusted config HTML, dynamic CSS/JS, or WordPress Customizer binding attributes. |
| 3 |
|
| 4 |
/** |
| 5 |
* Class Pix_Customize_Select2_Control |
| 6 |
*/ |
| 7 |
class Pix_Customize_Select2_Control extends Pix_Customize_Control { |
| 8 |
public $type = 'select2'; |
| 9 |
|
| 10 |
/** |
| 11 |
* Render the control's content. |
| 12 |
*/ |
| 13 |
public function render_content() { |
| 14 |
?> |
| 15 |
<label> |
| 16 |
<?php if ( ! empty( $this->label ) ) : ?> |
| 17 |
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
| 18 |
<?php endif; ?> |
| 19 |
|
| 20 |
<select <?php $this->link(); ?> class="customify_select2"> |
| 21 |
<?php |
| 22 |
foreach ( $this->choices as $value => $label ) |
| 23 |
echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>'; |
| 24 |
?> |
| 25 |
</select> |
| 26 |
|
| 27 |
<?php if ( ! empty( $this->description ) ) : ?> |
| 28 |
<span class="description customize-control-description"><?php echo $this->description; ?></span> |
| 29 |
<?php endif; ?> |
| 30 |
</label> |
| 31 |
<?php |
| 32 |
|
| 33 |
} |
| 34 |
} |
| 35 |
|