Skip to content

Commit

Permalink
Added unit param in Customizer number option
Browse files Browse the repository at this point in the history
  • Loading branch information
bfintal committed Jan 14, 2015
1 parent a899e40 commit a74960d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions class-option-number.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public function registerCustomizerControl( $wp_customize, $section, $priority =
'min' => $this->settings['min'],
'max' => $this->settings['max'],
'step' => $this->settings['step'],
'unit' => $this->settings['unit'],
) ) );
}
}
Expand All @@ -193,6 +194,7 @@ class TitanFrameworkOptionNumberControl extends WP_Customize_Control {
public $min;
public $max;
public $step;
public $unit;

private static $firstLoad = true;

Expand All @@ -208,6 +210,7 @@ public function render_content() {
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<span class='number-slider'></span>
<input class="<?php echo esc_attr( $this->size ) ?>-text" min="<?php echo esc_attr( $this->min ) ?>" max="<?php echo esc_attr( $this->max ) ?>" step="<?php echo esc_attr( $this->step ) ?>" type="number" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> />
<?php echo esc_html( $this->unit ) ?>
</label>
<?php
if ( ! empty( $this->description ) ) {
Expand Down
2 changes: 1 addition & 1 deletion css/admin-theme-customizer-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
border: 1px solid #ddd;
border-radius: 3px;
height: 15px;
width: 150px;
width: 120px;
display: inline-block;
vertical-align: middle;
margin: 15px 15px 15px 0;
Expand Down

0 comments on commit a74960d

Please sign in to comment.