Skip to content

Commit

Permalink
Kirki 3.0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
AlxMedia committed Mar 11, 2019
1 parent 233b685 commit 66a3503
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 19 deletions.
2 changes: 1 addition & 1 deletion functions/kirki/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: Ari Stathopoulos (@aristath)
* Author URI: http://aristath.github.io
* Version: 3.0.36
* Version: 3.0.38
* Text Domain: kirki
* Requires WP: 4.9
* Requires PHP: 5.3
Expand Down
23 changes: 12 additions & 11 deletions functions/kirki/modules/css/class-kirki-modules-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,18 @@ public function init() {
// Admin styles, adds compatibility with the new WordPress editor (Gutenberg).
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_styles' ), 100 );

add_action( 'wp', array( $this, 'print_styles_action' ) );

if ( ! apply_filters( 'kirki_output_inline_styles', true ) ) {
$config = apply_filters( 'kirki_config', array() );
$priority = 999;
if ( isset( $config['styles_priority'] ) ) {
$priority = absint( $config['styles_priority'] );
}
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), $priority );

// Prints the styles.
add_action( 'wp', array( $this, 'print_styles_action' ) );
return;
} else {
add_action( 'wp_head', array( $this, 'print_styles_inline' ), 999 );
}

add_action( 'wp_head', array( $this, 'print_styles_inline' ), 999 );
}

/**
Expand All @@ -142,14 +140,17 @@ public function print_styles_inline() {
*/
public function enqueue_styles() {

$args = array(
'action' => apply_filters( 'kirki_styles_action_handle', 'kirki-styles' ),
);
if ( is_admin() && ! is_customize_preview() ) {
$args['editor'] = '1';
}

// Enqueue the dynamic stylesheet.
wp_enqueue_style(
'kirki-styles',
add_query_arg(
'action',
apply_filters( 'kirki_styles_action_handle', 'kirki-styles' ),
site_url()
),
add_query_arg( $args, site_url() ),
array(),
KIRKI_VERSION
);
Expand Down
2 changes: 1 addition & 1 deletion functions/kirki/modules/css/class-kirki-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ protected function parse_output() {

$value = $this->process_value( $value, $output );

if ( is_admin() && ! is_customize_preview() ) {
if ( ( is_admin() && ! is_customize_preview() ) || ( isset( $_GET['editor'] ) && '1' === $_GET['editor'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification

// Check if this is an admin style.
if ( ! isset( $output['context'] ) || ! in_array( 'editor', $output['context'], true ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ public function postmessage() {
}
}
wp_localize_script( 'kirki_auto_postmessage', 'kirkiPostMessageFields', $data );
$extras = apply_filters( 'kirki_postmessage_script', false );
if ( $extras ) {
wp_add_inline_script( 'kirki_auto_postmessage', $extras, 'after' );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function admin_notice() {
<div class="notice notice-info kirki-telemetry">
<h3><strong><?php esc_html_e( 'Help us improve Kirki.', 'kirki' ); ?></strong></h3>
<p style="max-width: 76em;"><?php _e( 'Help us begin a dialogue with theme developers, collaborate and improve both the theme you are using and the Kirki framework by agreeing to send anonymous data. <strong>The data is completely anonymous and we will never collect any identifyable information about you or your website.</strong>', 'kirki' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></p>
<table class="data-to-send hidden widefat">
<table class="data-to-send hidden">
<thead>
<tr>
<th colspan="2"><?php esc_html_e( 'Data that will be sent', 'kirki' ); ?></th>
Expand Down Expand Up @@ -204,6 +204,8 @@ public function admin_notice() {
</script>
</div>
<?php

$this->table_styles();
}

/**
Expand Down Expand Up @@ -292,4 +294,34 @@ private function consent() {
}
}
}

/**
* Prints the table styles.
*
* Normally we'd just use the .widefat CSS class for the table,
* however apparently there's an obscure bug in WP causing this: https://github.com/aristath/kirki/issues/2067
* This CSS is a copy of some styles from common.css in wp-core.
*
* @access private
* @since 3.0.37
* @return void
*/
private function table_styles() {
?>
<style>
/* .widefat - main style for tables */
.data-to-send { border-spacing: 0; width: 100%; clear: both; }
.data-to-send * { word-wrap: break-word; }
.data-to-send a, .data-to-send button.button-link { text-decoration: none; }
.data-to-send td, .data-to-send th { padding: 8px 10px; }
.data-to-send thead th, .data-to-send thead td { border-bottom: 1px solid #e1e1e1; }
.data-to-send tfoot th, .data-to-send tfoot td { border-top: 1px solid #e1e1e1; border-bottom: none; }
.data-to-send .no-items td { border-bottom-width: 0; }
.data-to-send td { vertical-align: top; }
.data-to-send td, .data-to-send td p, .data-to-send td ol, .data-to-send td ul { font-size: 13px; line-height: 1.5em; }
.data-to-send th, .data-to-send thead td, .data-to-send tfoot td { text-align: left; line-height: 1.3em; font-size: 14px; }
.data-to-send th input, .updates-table td input, .data-to-send thead td input, .data-to-send tfoot td input { margin: 0 0 0 8px; padding: 0; vertical-align: text-top; }
</style>
<?php
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function init() {
* @return string
*/
public function get_method() {
return ( is_customize_preview() ) ? 'async' : 'embed';
return ( is_customize_preview() || is_admin() ) ? 'async' : 'embed';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion functions/kirki/modules/webfonts/webfont-files.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion functions/kirki/modules/webfonts/webfont-names.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion functions/kirki/modules/webfonts/webfonts.json

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion functions/kirki/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, gutenberg
Donate link: https://aristath.github.io/donate
Requires at least: 4.9
Tested up to: 5.0
Stable tag: 3.0.36
Stable tag: 3.0.38
License: MIT
License URI: https://opensource.org/licenses/MIT

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

== Changelog ==

= 3.0.38 =

Mar. 1, 2019, dev time: 20m.

* Fix: Editor styles.
* Update: Updated the Google Fonts list.

= 3.0.37 =

Feb. 26, 2019, dev time: 1h.

* Fix: CSS conflict in posts quickedit table
* Fix: Load webfonts in the dashboard.
* Fix: Add back the `kirki_auto_postmessage` filter.
* Update: Updated the Google Fonts list.

= 3.0.36 =

Feb. 17, 2019, dev time > 100h
Expand Down

0 comments on commit 66a3503

Please sign in to comment.