Buttonset_Custom_Control

Class to create a custom tags control.

Defined (1)

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

/lib/customizer/includes/buttonset-custom-control.php  
  1. class Buttonset_Custom_Control extends WP_Customize_Control { 
  2.  
  3. public function enqueue() { 
  4. wp_enqueue_script( 'jquery-ui-button' ); 
  5.  
  6. /** 
  7. * Render the content on the theme customizer page 
  8. */ 
  9. public function render_content() { 
  10. ?> 
  11. <label> 
  12. <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 
  13. <span class="description customize-control-description"><?php echo esc_attr( $this->description ); ?></span> 
  14. <div id="buttonset-<?php echo $this->id; ?>"> 
  15. <?php foreach ( $this->choices as $value => $label ) : ?> 
  16. <input type="radio" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $this->id ); ?>" id="<?php echo $this->id .'-'. $value; ?>" <?php $this->link(); checked( $this->value(), $value ); ?>> 
  17. <label for="<?php echo $this->id .'-'. $value; ?>"> 
  18. <?php echo esc_html( $label ); ?> 
  19. </label> 
  20. </input> 
  21. <?php endforeach; ?> 
  22. </div> 
  23. <script> 
  24. jQuery(document).ready(function($) { 
  25. $( '[id="buttonset-<?php echo $this->id; ?>"]' ).buttonset(); 
  26. }); 
  27. </script> 
  28. </label> 
  29. <?php