File manager - Edit - /home/xfekoga/rooftopcleaners/wp-includes/widgets/code.tar
Back
consultstreet-customize-slider-control.php 0000644 00000003750 15174425100 0015155 0 ustar 00 <?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() { } } consultstreet-customize-sortable-control.php 0000644 00000003451 15174425100 0015504 0 ustar 00 <?php /** * Customize Sortable control class. * * @package consultstreet * * @see WP_Customize_Control * @access public */ /** * Class ConsultStreet_Customize_Sortable_Control */ class ConsultStreet_Customize_Sortable_Control extends ConsultStreet_Customize_Base_Control { /** * Customize control type. * * @access public * @var string */ public $type = 'consultstreet-sortable'; /** * Renders the Underscore template for this control. * * @see WP_Customize_Control::print_template() * @access protected * @return void */ protected function content_template() { ?> <label class='consultstreet-sortable'> <span class="customize-control-title"> {{{ data.label }}} </span> <# if ( data.description ) { #> <span class="description customize-control-description">{{{ data.description }}}</span> <# } #> <ul class="sortable"> <# _.each( data.value, function( choiceID ) { #> <li {{{ data.inputAttrs }}} class='consultstreet-sortable-item' data-value='{{ choiceID }}'> <i class='dashicons dashicons-menu'></i> <i class="dashicons dashicons-visibility visibility"></i> {{{ data.choices[ choiceID ] }}} </li> <# }); #> <# _.each( data.choices, function( choiceLabel, choiceID ) { #> <# if ( -1 === data.value.indexOf( choiceID ) ) { #> <li {{{ data.inputAttrs }}} class='consultstreet-sortable-item invisible' data-value='{{ choiceID }}'> <i class='dashicons dashicons-menu'></i> <i class="dashicons dashicons-visibility visibility"></i> {{{ data.choices[ choiceID ] }}} </li> <# } #> <# }); #> </ul> </label> <?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() { } } consultstreet-customize-category-control.php 0000644 00000002717 15174425100 0015512 0 ustar 00 <?php /** * Customize Editor control class. * * @package consultstreet * * @see WP_Customize_Control * @access public */ if ( ! class_exists( 'WP_Customize_Control' ) ) return NULL; /** * Class ConsultStreet_Customize_Category_Control */ class ConsultStreet_Customize_Category_Control extends WP_Customize_Control { private $cats = false; public function __construct($manager, $id, $args = array(), $options = array()) { $this->cats = get_categories($options); parent::__construct( $manager, $id, $args ); } /** * Render the content of the category dropdown * * @return HTML */ public function render_content() { if(!empty($this->cats)) { ?> <label> <span class="customize-category-select-control"><?php echo esc_html( $this->label ); ?></span> <select multiple <?php $this->link(); ?>> <?php foreach ( $this->cats as $cat ) { printf('<option value="%s" %s>%s</option>', esc_html( $cat->term_id ), selected($this->value(), $cat->term_id, false), esc_html( $cat->name )); } ?> </select> </label> <?php } } } ?>