Skip to content

Commit

Permalink
Merge pull request #1693 from aristath/develop
Browse files Browse the repository at this point in the history
3.0.19
  • Loading branch information
aristath authored Dec 11, 2017
2 parents 99ec5b3 + 3e49534 commit ea43f3f
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 9 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Donate link:** https://aristath.github.io/donate
**Requires at least:** 4.8.2
**Tested up to:** 4.9.2
**Stable tag:** 3.0.17
**Stable tag:** 3.0.19
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -33,6 +33,20 @@ If you want to integrate Kirki in your theme or plugin, please read the instruct

## Changelog ##

### 3.0.19 ###

December 8 2017, dev time: 20 minutes.

* Fix: WebfontLoader using `i` instead of `400i`.
* Fix: Sometimes `font-weight` and `font-style` don't get applied.

### 3.0.18 ###

December 6 2017, dev time: 1 hour.

* Fix: Standards fonts sometimes not showing in typography control [#1689](https://github.com/aristath/kirki/issues/1689)
* Fix: missing .min.css file

### 3.0.17 ###

December 5 2017, dev time: 46 hours
Expand Down
1 change: 1 addition & 0 deletions controls/class-kirki-controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Kirki_Controls {
* @var array
*/
private $templates = array(
'code',
'color',
'generic',
'radio',
Expand Down
9 changes: 9 additions & 0 deletions controls/js/dist/script-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ kirki = jQuery.extend( kirki, {
*/
control: {

/**
* The code control.
*
* @since 3.0.18
*/
'kirki-code': {

},

/**
* The radio control.
*
Expand Down
2 changes: 1 addition & 1 deletion controls/js/dist/script-legacy.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions controls/js/dist/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ kirki = jQuery.extend( kirki, {
*/
control: {

/**
* The code control.
*
* @since 3.0.18
*/
'kirki-code': {

},

/**
* The radio control.
*
Expand Down
2 changes: 1 addition & 1 deletion controls/js/dist/script.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions controls/js/src/kirki.control.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ kirki = jQuery.extend( kirki, {
*/
control: {

/**
* The code control.
*
* @since 3.0.18
*/
'kirki-code': {

},

/**
* The radio control.
*
Expand Down
24 changes: 24 additions & 0 deletions controls/views/code.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<#
data = _.defaults( data, {
id: '',
label: '',
description: '',
input_attrs: {}
});
<# var elementIdPrefix = 'el' + String( Math.random() ); #>
<div class="kirki-input-container" data-id="{{ data.id }}">
<# if ( data.label ) { #>
<label for="{{ elementIdPrefix }}_editor" class="customize-control-title">
{{ data.label }}
</label>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<div class="customize-control-notifications-container"></div>
<textarea id="{{ elementIdPrefix }}_editor"
<# _.each( _.extend( { 'class': 'code' }, data.input_attrs ), function( value, key ) { #>
{{{ key }}}="{{ value }}"
<# }); #>
></textarea>
</div>
2 changes: 1 addition & 1 deletion kirki.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The ultimate WordPress Customizer Toolkit
* Author: Aristeides Stathopoulos
* Author URI: http://aristath.github.io
* Version: 3.0.18
* Version: 3.0.19
* Text Domain: kirki
*
* GitHub Plugin URI: aristath/kirki
Expand Down
17 changes: 17 additions & 0 deletions modules/css/field/class-kirki-output-field-typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ protected function process_output( $output, $value ) {
$properties = array(
'font-family',
'font-size',
'variant',
'font-weight',
'font-style',
'letter-spacing',
Expand Down Expand Up @@ -61,6 +62,22 @@ protected function process_output( $output, $value ) {
continue;
}

// Take care of variants.
if ( 'variant' == $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) {

// Get the font_weight.
$font_weight = str_replace( 'italic', '', $value['variant'] );
$font_weight = ( in_array( $font_weight, array( '', 'regular' ) ) ) ? '400' : $font_weight;

// Is this italic?
$is_italic = ( false !== strpos( $value['variant'], 'italic' ) );
$this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight;
if ( $is_italic ) {
$this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic';
}
continue;
}

$property_value = $this->process_property_value( $property, $value[ $property ] );
if ( 'font-family' === $property ) {
$value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : '';
Expand Down
5 changes: 3 additions & 2 deletions modules/webfonts/class-kirki-modules-webfonts-async.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ public function webfont_loader() {
$fonts_to_load = array();
foreach ( $this->googlefonts->fonts as $font => $weights ) {
foreach ( $weights as $key => $value ) {
$weights[ $key ] = str_replace( array( 'regular', 'bold', 'italic' ), array( '400', '', 'i' ), $value );
if ( 'i' === $value ) {
if ( 'italic' === $value ) {
$weights[ $key ] = '400i';
} else {
$weights[ $key ] = str_replace( array( 'regular', 'bold', 'italic' ), array( '400', '', 'i' ), $value );
}
}
$fonts_to_load[] = $font . ':' . join( ',', $weights );
Expand Down
2 changes: 1 addition & 1 deletion modules/webfonts/webfonts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/webfonts/webfonts.php

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: customizer,options framework, theme, mods, toolkit
Donate link: https://aristath.github.io/donate
Requires at least: 4.8.2
Tested up to: 4.9.2
Stable tag: 3.0.18
Stable tag: 3.0.19
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -33,6 +33,13 @@ If you want to integrate Kirki in your theme or plugin, please read the instruct

== Changelog ==

= 3.0.19 =

December 8 2017, dev time: 20 minutes.

* Fix: WebfontLoader using `i` instead of `400i`.
* Fix: Sometimes `font-weight` and `font-style` don't get applied.

= 3.0.18 =

December 6 2017, dev time: 1 hour.
Expand Down

0 comments on commit ea43f3f

Please sign in to comment.