languages
3 years ago
CustomHtmlControl.php
3 years ago
CustomTextControl.php
3 years ago
VkCssOptimize.php
1 year ago
class-css-tree-shaking.php
3 years ago
CustomTextControl.php
39 lines
| 1 | <?php //phpcs:ignore |
| 2 | /** |
| 3 | * CustomTextControl |
| 4 | * |
| 5 | * @package vektor-inc/vk-css-optimize |
| 6 | * @license GPL-2.0+ |
| 7 | * |
| 8 | * @version 0.0.1 |
| 9 | */ |
| 10 | |
| 11 | namespace VektorInc\VK_CSS_Optimize; |
| 12 | |
| 13 | /** |
| 14 | * CustomTextControl |
| 15 | */ |
| 16 | class CustomTextControl extends \WP_Customize_Control { |
| 17 | public $type = 'customtext'; |
| 18 | public $description = ''; // we add this for the extra description. |
| 19 | public $input_before = ''; |
| 20 | public $input_after = ''; |
| 21 | /** |
| 22 | * Render Content |
| 23 | */ |
| 24 | public function render_content() { |
| 25 | ?> |
| 26 | <label> |
| 27 | <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
| 28 | <?php $style = ( $this->input_before || $this->input_after ) ? ' style="width:50%"' : ''; ?> |
| 29 | <div> |
| 30 | <?php echo wp_kses_post( $this->input_before ); ?> |
| 31 | <input type="text" value="<?php echo esc_attr( $this->value() ); ?>"<?php echo $style; ?> <?php $this->link(); ?> /> |
| 32 | <?php echo wp_kses_post( $this->input_after ); ?> |
| 33 | </div> |
| 34 | <div><?php echo $this->description; ?></div> |
| 35 | </label> |
| 36 | <?php |
| 37 | } // public function render_content() { |
| 38 | } |
| 39 |