Chosen_Custom_Control

Class to create a custom post control.

Defined (1)

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

/lib/customizer/includes/chosen-custom-control.php  
  1. class Chosen_Custom_Control extends WP_Customize_Control { 
  2. public $choices = false; 
  3.  
  4. public function __construct( $manager, $id, $args = array(), $options = array() ) { 
  5.  
  6. parent::__construct( $manager, $id, $args ); 
  7.  
  8. /** 
  9. * Render the content on the theme customizer page 
  10. */ 
  11. public function render_content() { 
  12.  
  13. if ( ! empty( $this->choices ) ) { 
  14. ?> 
  15. <label> 
  16. <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 
  17. <span class="description customize-control-description"><?php echo esc_attr( $this->description ); ?></span> 
  18. <select <?php $this->link(); ?> class="koo-chosen" style="width:100%;"> 
  19. <?php 
  20. foreach ( $this->choices as $value => $label ) 
  21. echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>'; 
  22. ?> 
  23. </select> 
  24. </label> 
  25. <?php