Skip to content

Commit

Permalink
Fixes #1443
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jul 5, 2017
1 parent 3bf310f commit 2453278
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions field/class-kirki-field-typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@ protected function set_type() {

}

/**
* Sets the default value.
*
* @access protected
*/
protected function set_default() {

// Accomodate the use of font-weight and convert to variant.
if ( isset( $this->default['font-weight'] ) ) {
$this->default['variant'] = ( 'regular' === $this->default['font-weight'] ) ? 400 : (string) intval( $this->default['font-weight' ] );
}

// Make sure letter-spacing has units.
if ( isset( $this->default['letter-spacing'] ) && is_numeric( $this->default['letter-spacing'] ) && $this->default['letter-spacing'] ) {
$this->default['letter-spacing'] .= 'px';
}

// Make sure we use "subsets" instead of "subset".
if ( isset( $this->default['subset'] ) && ! empty( $this->default['subset'] ) && ( ! isset( $this->default['subsets'] ) || empty( $this->default['subsets'] ) ) ) {
$this->default['subsets'] = $this->default['subset'];
}
// var_dump( $this->default );
}

/**
* Sets the $sanitize_callback
*
Expand Down

0 comments on commit 2453278

Please sign in to comment.