Skip to content

Commit

Permalink
fixes #1367
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jun 18, 2017
1 parent c530dbe commit 3053069
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/webfonts/class-kirki-modules-webfonts-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ public function __construct( $config_id, $webfonts, $googlefonts, $args = array(
$this->googlefonts = $googlefonts;

add_filter( "kirki/{$config_id}/dynamic_css", array( $this, 'embed_css' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'inline_css' ), 999 );
}

/**
* Adds inline css.
*
* @access public
* @since 3.0.0
*/
public function inline_css() {
wp_add_inline_style( 'kirki-styles', $this->embed_css() );
}

/**
Expand All @@ -77,7 +88,7 @@ public function __construct( $config_id, $webfonts, $googlefonts, $args = array(
* @param string $css The original CSS.
* @return string The modified CSS.
*/
public function embed_css( $css ) {
public function embed_css( $css = '' ) {

// Go through our fields and populate $this->fonts.
$this->webfonts->loop_fields( $this->config_id );
Expand Down

0 comments on commit 3053069

Please sign in to comment.