File Editor
Directories:
.. (Back)
Files:
consultstreet-customize-base-control.php
consultstreet-customize-category-control.php
consultstreet-customize-color-control.php
consultstreet-customize-heading-control.php
consultstreet-customize-plugin-control.php
consultstreet-customize-radio-buttonset-control.php
consultstreet-customize-radio-image-control.php
consultstreet-customize-slider-control.php
consultstreet-customize-sortable-control.php
consultstreet-customize-toggle-control.php
consultstreet-customize-typography-control.php
consultstreet-customize-upgrade-control.php
Create New File
Create
Edit File: consultstreet-customize-slider-control.php
<?php /** * Customize Slider control class. * * @package consultstreet * * @see WP_Customize_Control * @access public */ /** * Class ConsultStreet_Customize_Slider_Control */ class ConsultStreet_Customize_Slider_Control extends ConsultStreet_Customize_Base_Control { /** * Customize control type. * * @access public * @var string */ public $type = 'consultstreet-slider'; /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() * @access public * @return void */ public function to_json() { parent::to_json(); if ( is_array( $this->json['default'] ) ) { foreach ( $this->json['default'] as $key => $value ) { $this->json['choices']['controls'][ $key ] = true; } } } /** * Renders the Underscore template for this control. * * @see WP_Customize_Control::print_template() * @access protected * @return void */ protected function content_template() { ?> <# if ( data.label ) { #> <span class="customize-control-title">{{ data.label }}</span> <# } #> <# if ( data.description ) { #> <span class="description customize-control-description">{{{ data.description }}}</span> <# } #> <div class="customize-control-content"> <div class="consultstreet-slider"> <div id="custom-handle" class="ui-slider-handle"></div> </div> <div class="consultstreet-slider-input"> <input {{{ data.inputAttrs }}} type="number" class="slider-input" value="{{ data.value['slider'] }}"/> <input type="text" value="{{ data.default['suffix'] }}" hidden> <span class="suffix">{{ data.default['suffix'] }}</span> <span class="slider-reset dashicons dashicons-image-rotate"><span class="screen-reader-text"><?php esc_html_e( 'Reset', 'consultstreet' ); ?></span></span> </div> </div> <?php } /** * Render content is still called, so be sure to override it with an empty function in your subclass as well. */ protected function render_content() { } }
Save Changes
Rename File
Rename