Image_Select_Control

Class to create a image select.

Defined (1)

The class is defined in the following location(s).

/lib/customizer/includes/image-select-custom-control.php  
  1. class Image_Select_Control extends WP_Customize_Control { 
  2.  
  3. public function render_content() { 
  4. $name = '_customize-radio-' . $this->id; 
  5. ?> 
  6. <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 
  7. <span class="description customize-control-description"><?php echo esc_attr( $this->description ); ?></span> 
  8. <?php foreach ( $this->choices as $value => $image ) : ?> 
  9. <?php $class_selected = ( $this->value() == $value ) ? ' onetone-radio-img-selected' : ''; ?> 
  10. <label class="image-radio-control"> 
  11. <input type="radio" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" <?php $this->link(); checked( $this->value(), $value ); ?> class="screen-reader-text" /> 
  12. <span class="control-image"> 
  13. <img src="<?php echo esc_html( $image ); ?>" class="onetone-radio-img<?php echo $class_selected; ?>"/> 
  14. </span> 
  15. </label> 
  16. <?php endforeach; 
  17.