min = is_numeric( $args['min'] ) ? floatval( $args['min'] ) : 0; } if ( isset( $args['max'] ) ) { $this->max = is_numeric( $args['max'] ) ? floatval( $args['max'] ) : 100; } if ( isset( $args['step'] ) ) { $this->step = is_numeric( $args['step'] ) ? floatval( $args['step'] ) : 1; } if ( isset( $args['unit'] ) ) { $this->unit = sanitize_text_field( $args['unit'] ); } } /** * Enqueue control related scripts/styles */ public function enqueue() { wp_enqueue_script( 'accepta-range-control', get_template_directory_uri() . '/inc/customizer-controls/js/range-control.js', array( 'jquery', 'customize-base' ), wp_get_theme()->get( 'Version' ), true ); wp_enqueue_style( 'accepta-range-control', get_template_directory_uri() . '/inc/customizer-controls/css/range-control.css', array(), wp_get_theme()->get( 'Version' ) ); } /** * Render the control's content */ public function render_content() { $input_id = '_customize-input-' . $this->id; $description_id = '_customize-description-' . $this->id; $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '"' : ''; $value = $this->value(); ?>