From 2ed8bc86b41c067726c3eaca04114cd45b920a13 Mon Sep 17 00:00:00 2001 From: Alexander Agnarson Date: Mon, 11 Mar 2019 16:19:14 +0100 Subject: [PATCH] Kirki 3.0.38 --- functions/kirki/kirki.php | 2 +- .../modules/css/class-kirki-modules-css.php | 23 +++++++------ .../kirki/modules/css/class-kirki-output.php | 2 +- .../class-kirki-modules-postmessage.php | 4 +++ .../class-kirki-modules-telemetry.php | 34 ++++++++++++++++++- .../webfonts/class-kirki-modules-webfonts.php | 2 +- .../kirki/modules/webfonts/webfont-files.json | 2 +- .../kirki/modules/webfonts/webfont-names.json | 2 +- .../kirki/modules/webfonts/webfonts.json | 2 +- functions/kirki/readme.txt | 18 +++++++++- 10 files changed, 72 insertions(+), 19 deletions(-) diff --git a/functions/kirki/kirki.php b/functions/kirki/kirki.php index 84a8689..e8b3dc6 100644 --- a/functions/kirki/kirki.php +++ b/functions/kirki/kirki.php @@ -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 diff --git a/functions/kirki/modules/css/class-kirki-modules-css.php b/functions/kirki/modules/css/class-kirki-modules-css.php index 74e6c06..be66dcf 100644 --- a/functions/kirki/modules/css/class-kirki-modules-css.php +++ b/functions/kirki/modules/css/class-kirki-modules-css.php @@ -104,6 +104,8 @@ class Kirki_Modules_CSS { // 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; @@ -111,13 +113,9 @@ class Kirki_Modules_CSS { $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 ); } /** @@ -142,14 +140,17 @@ class Kirki_Modules_CSS { */ 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 ); diff --git a/functions/kirki/modules/css/class-kirki-output.php b/functions/kirki/modules/css/class-kirki-output.php index 1cc33eb..ba07f32 100644 --- a/functions/kirki/modules/css/class-kirki-output.php +++ b/functions/kirki/modules/css/class-kirki-output.php @@ -243,7 +243,7 @@ class Kirki_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 ) ) { diff --git a/functions/kirki/modules/postmessage/class-kirki-modules-postmessage.php b/functions/kirki/modules/postmessage/class-kirki-modules-postmessage.php index e8e41fd..2fc93ab 100644 --- a/functions/kirki/modules/postmessage/class-kirki-modules-postmessage.php +++ b/functions/kirki/modules/postmessage/class-kirki-modules-postmessage.php @@ -71,5 +71,9 @@ class Kirki_Modules_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' ); + } } } diff --git a/functions/kirki/modules/telemetry/class-kirki-modules-telemetry.php b/functions/kirki/modules/telemetry/class-kirki-modules-telemetry.php index fc083ce..47a1be6 100644 --- a/functions/kirki/modules/telemetry/class-kirki-modules-telemetry.php +++ b/functions/kirki/modules/telemetry/class-kirki-modules-telemetry.php @@ -145,7 +145,7 @@ final class Kirki_Modules_Telemetry {

The data is completely anonymous and we will never collect any identifyable information about you or your website.', 'kirki' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>

- + @@ -204,6 +204,8 @@ final class Kirki_Modules_Telemetry { table_styles(); } /** @@ -292,4 +294,34 @@ final class Kirki_Modules_Telemetry { } } } + + /** + * 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() { + ?> + + 100h