Kirki 3.0.38

This commit is contained in:
Alexander Agnarson 2019-03-11 16:19:14 +01:00
parent 2c33dc1f57
commit 2ed8bc86b4
10 changed files with 72 additions and 19 deletions

View file

@ -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

View file

@ -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
);

View file

@ -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 ) ) {

View file

@ -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' );
}
}
}

View file

@ -145,7 +145,7 @@ final class Kirki_Modules_Telemetry {
<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>
@ -204,6 +204,8 @@ final class Kirki_Modules_Telemetry {
</script>
</div>
<?php
$this->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() {
?>
<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
}
}

View file

@ -106,7 +106,7 @@ class Kirki_Modules_Webfonts {
* @return string
*/
public function get_method() {
return ( is_customize_preview() ) ? 'async' : 'embed';
return ( is_customize_preview() || is_admin() ) ? 'async' : 'embed';
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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
@ -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