LabelControl.php (1091B)
1 <?php 2 3 namespace Materialis\Customizer\Controls; 4 5 class LabelControl extends \Materialis\Customizer\BaseControl 6 { 7 public function init() 8 { 9 10 } 11 12 13 public function render() 14 { 15 $id = 'customize-control-' . str_replace(array( '[', ']' ), array( '-', '' ), $this->id); 16 $class = 'customize-control customize-control-' . $this->type; ?> 17 18 <li id="<?php echo esc_attr($id); ?>" class="cp-label-control <?php echo esc_attr($class); ?>"> 19 <?php $this->render_content(); ?> 20 </li> 21 <?php 22 23 } 24 25 26 public function render_content() 27 { 28 ?> 29 <label> 30 <?php if ( ! empty( $this->label ) ) : ?> 31 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 32 <?php endif; 33 if ( ! empty( $this->description ) ) : ?> 34 <span class="description customize-control-description"><?php echo $this->description; ?></span> 35 <?php endif; ?> 36 37 </label> 38 <?php 39 } 40 }