Version Description
Download this release
Release Info
Developer | vlad.olaru |
Plugin | Customify – A Theme Customizer Booster |
Version | 2.3.3 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.3.3
- class-pixcustomify.php +23 -24
- customify.php +4 -2
- features/class-Font_Selector.php +49 -47
- includes/class-customify-gutenberg.php +2 -2
- readme.txt +1 -1
class-pixcustomify.php
CHANGED
@@ -937,30 +937,29 @@ class PixCustomifyPlugin {
|
|
937 |
if ( ! empty ( $families ) && $this->get_plugin_setting( 'typography', '1' ) && $this->get_plugin_setting( 'typography_google_fonts', 1 ) ) {
|
938 |
ob_start();
|
939 |
?>
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
<?php
|
964 |
$output = ob_get_clean();
|
965 |
}
|
966 |
|
937 |
if ( ! empty ( $families ) && $this->get_plugin_setting( 'typography', '1' ) && $this->get_plugin_setting( 'typography_google_fonts', 1 ) ) {
|
938 |
ob_start();
|
939 |
?>
|
940 |
+
if (typeof WebFont !== 'undefined') {<?php // if there is a WebFont object, use it ?>
|
941 |
+
WebFont.load({
|
942 |
+
google: {families: [<?php echo( rtrim( $families, ',' ) ); ?>]},
|
943 |
+
classes: false,
|
944 |
+
events: false
|
945 |
+
});
|
946 |
+
} else {<?php // basically when we don't have the WebFont object we create the google script dynamically ?>
|
947 |
+
|
948 |
+
var tk = document.createElement('script');
|
949 |
+
tk.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
|
950 |
+
tk.type = 'text/javascript';
|
951 |
+
|
952 |
+
tk.onload = tk.onreadystatechange = function () {
|
953 |
+
WebFont.load({
|
954 |
+
google: {families: [<?php echo( rtrim( $families, ',' ) ); ?>]},
|
955 |
+
classes: false,
|
956 |
+
events: false
|
957 |
+
});
|
958 |
+
};
|
959 |
+
|
960 |
+
var s = document.getElementsByTagName('script')[0];
|
961 |
+
s.parentNode.insertBefore(tk, s);
|
962 |
+
}<?php
|
|
|
963 |
$output = ob_get_clean();
|
964 |
}
|
965 |
|
customify.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Customify
|
4 |
Plugin URI: https://wordpress.org/plugins/customify/
|
5 |
Description: A Theme Customizer Booster
|
6 |
-
Version: 2.3.
|
7 |
Author: Pixelgrade
|
8 |
Author URI: https://pixelgrade.com
|
9 |
Author Email: contact@pixelgrade.com
|
@@ -11,6 +11,8 @@ Text Domain: customify
|
|
11 |
License: GPL-2.0+
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
13 |
Domain Path: /languages/
|
|
|
|
|
14 |
*/
|
15 |
|
16 |
// If this file is called directly, abort.
|
@@ -61,7 +63,7 @@ function PixCustomifyPlugin() {
|
|
61 |
*/
|
62 |
require_once plugin_dir_path( __FILE__ ) . 'class-pixcustomify.php';
|
63 |
|
64 |
-
$instance = PixCustomifyPlugin::instance( __FILE__, '2.3.
|
65 |
|
66 |
return $instance;
|
67 |
}
|
3 |
Plugin Name: Customify
|
4 |
Plugin URI: https://wordpress.org/plugins/customify/
|
5 |
Description: A Theme Customizer Booster
|
6 |
+
Version: 2.3.3
|
7 |
Author: Pixelgrade
|
8 |
Author URI: https://pixelgrade.com
|
9 |
Author Email: contact@pixelgrade.com
|
11 |
License: GPL-2.0+
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
13 |
Domain Path: /languages/
|
14 |
+
Requires at least: 4.9
|
15 |
+
Tested up to: 5.0.2
|
16 |
*/
|
17 |
|
18 |
// If this file is called directly, abort.
|
63 |
*/
|
64 |
require_once plugin_dir_path( __FILE__ ) . 'class-pixcustomify.php';
|
65 |
|
66 |
+
$instance = PixCustomifyPlugin::instance( __FILE__, '2.3.3' );
|
67 |
|
68 |
return $instance;
|
69 |
}
|
features/class-Font_Selector.php
CHANGED
@@ -109,7 +109,7 @@ class Customify_Font_Selector {
|
|
109 |
foreach ( $this->theme_fonts as $font ) {
|
110 |
if ( ! empty( $font ) ) {
|
111 |
//display the select option's HTML
|
112 |
-
Pix_Customize_Font_Control::output_font_option( $font
|
113 |
}
|
114 |
}
|
115 |
echo "</optgroup>";
|
@@ -176,7 +176,20 @@ class Customify_Font_Selector {
|
|
176 |
$value['type'] = 'google';
|
177 |
}
|
178 |
|
179 |
-
if ( isset( $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
$family = "'" . $value['font_family'];
|
181 |
|
182 |
if ( $load_all_weights && ! empty( $value['variants'] ) && is_array( $value['variants'] ) ) {
|
@@ -212,19 +225,6 @@ class Customify_Font_Selector {
|
|
212 |
$family .= "'";
|
213 |
|
214 |
$args['google_families'][] = $family;
|
215 |
-
} elseif ( isset( $this->theme_fonts[ $value['font_family'] ] ) ) {
|
216 |
-
|
217 |
-
// $value['type'] = 'theme_font';
|
218 |
-
// $args['local_srcs'] .= $this->theme_fonts[ $value['font_family'] ]['src'] . ',';
|
219 |
-
// $value['variants'] = $this->theme_fonts[ $value['font_family'] ]['variants'];
|
220 |
-
|
221 |
-
if ( false === array_search( $value['font_family'], $args['local_families'] ) ) {
|
222 |
-
$args['local_families'][] = "'" . $value['font_family'] . "'";
|
223 |
-
}
|
224 |
-
|
225 |
-
if ( false === array_search( $this->theme_fonts[ $value['font_family'] ]['src'], $args['local_srcs'] ) ) {
|
226 |
-
$args['local_srcs'][] = "'" . $this->theme_fonts[ $value['font_family'] ]['src'] . "'";
|
227 |
-
}
|
228 |
}
|
229 |
}
|
230 |
}
|
@@ -514,38 +514,40 @@ class Customify_Font_Selector {
|
|
514 |
return '';
|
515 |
}
|
516 |
|
517 |
-
ob_start();
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
|
|
|
|
549 |
<?php
|
550 |
$output = ob_get_clean();
|
551 |
|
109 |
foreach ( $this->theme_fonts as $font ) {
|
110 |
if ( ! empty( $font ) ) {
|
111 |
//display the select option's HTML
|
112 |
+
Pix_Customize_Font_Control::output_font_option( $font, $active_font_family, 'theme_font' );
|
113 |
}
|
114 |
}
|
115 |
echo "</optgroup>";
|
176 |
$value['type'] = 'google';
|
177 |
}
|
178 |
|
179 |
+
if ( isset( $this->theme_fonts[ $value['font_family'] ] ) ) {
|
180 |
+
|
181 |
+
// $value['type'] = 'theme_font';
|
182 |
+
// $args['local_srcs'] .= $this->theme_fonts[ $value['font_family'] ]['src'] . ',';
|
183 |
+
// $value['variants'] = $this->theme_fonts[ $value['font_family'] ]['variants'];
|
184 |
+
|
185 |
+
if ( false === array_search( $value['font_family'], $args['local_families'] ) ) {
|
186 |
+
$args['local_families'][] = "'" . $value['font_family'] . "'";
|
187 |
+
}
|
188 |
+
|
189 |
+
if ( false === array_search( $this->theme_fonts[ $value['font_family'] ]['src'], $args['local_srcs'] ) ) {
|
190 |
+
$args['local_srcs'][] = "'" . $this->theme_fonts[ $value['font_family'] ]['src'] . "'";
|
191 |
+
}
|
192 |
+
} elseif ( isset( $value['font_family'] ) && isset( $value['type'] ) && $value['type'] === 'google' ) {
|
193 |
$family = "'" . $value['font_family'];
|
194 |
|
195 |
if ( $load_all_weights && ! empty( $value['variants'] ) && is_array( $value['variants'] ) ) {
|
225 |
$family .= "'";
|
226 |
|
227 |
$args['google_families'][] = $family;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
229 |
}
|
230 |
}
|
514 |
return '';
|
515 |
}
|
516 |
|
517 |
+
ob_start(); ?>
|
518 |
+
function customify_font_loader() {
|
519 |
+
var webfontargs = {
|
520 |
+
classes: false,
|
521 |
+
events: false
|
522 |
+
};
|
523 |
+
<?php if ( ! empty( $args['google_families'] ) ) { ?>
|
524 |
+
webfontargs.google = {
|
525 |
+
families: [<?php echo join( ',', $args['google_families'] ); ?>]
|
526 |
+
};
|
527 |
+
<?php }
|
528 |
+
if ( ! empty( $args['local_families'] ) && ! empty( $args['local_srcs'] ) ) { ?>
|
529 |
+
webfontargs.custom = {
|
530 |
+
families: [<?php echo join( ',', $args['local_families'] ); ?>],
|
531 |
+
urls: [<?php echo join( ',', $args['local_srcs'] ) ?>]
|
532 |
+
};
|
533 |
+
<?php } ?>
|
534 |
+
WebFont.load(webfontargs);
|
535 |
+
};
|
536 |
+
|
537 |
+
if (typeof WebFont !== 'undefined') {
|
538 |
+
customify_font_loader();
|
539 |
+
} else {
|
540 |
+
var tk = document.createElement('script');
|
541 |
+
tk.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
|
542 |
+
tk.type = 'text/javascript';
|
543 |
+
|
544 |
+
tk.onload = tk.onreadystatechange = function () {
|
545 |
+
customify_font_loader();
|
546 |
+
};
|
547 |
+
|
548 |
+
var s = document.getElementsByTagName('script')[0];
|
549 |
+
s.parentNode.insertBefore(tk, s);
|
550 |
+
}
|
551 |
<?php
|
552 |
$output = ob_get_clean();
|
553 |
|
includes/class-customify-gutenberg.php
CHANGED
@@ -217,12 +217,12 @@ class Customify_Gutenberg {
|
|
217 |
|
218 |
if ( PixCustomifyPlugin()->get_plugin_setting( 'enable_editor_style', true ) ) {
|
219 |
add_filter( 'customify_typography_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 );
|
220 |
-
wp_add_inline_script(
|
221 |
wp_add_inline_style( $enqueue_parent_handle, PixCustomifyPlugin()->get_typography_dynamic_style() );
|
222 |
remove_filter( 'customify_typography_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10 );
|
223 |
|
224 |
add_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 );
|
225 |
-
wp_add_inline_script(
|
226 |
wp_add_inline_style( $enqueue_parent_handle, Customify_Font_Selector::instance()->get_fonts_dynamic_style() );
|
227 |
remove_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10 );
|
228 |
|
217 |
|
218 |
if ( PixCustomifyPlugin()->get_plugin_setting( 'enable_editor_style', true ) ) {
|
219 |
add_filter( 'customify_typography_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 );
|
220 |
+
wp_add_inline_script( 'wp-editor', PixCustomifyPlugin()->get_typography_dynamic_script() );
|
221 |
wp_add_inline_style( $enqueue_parent_handle, PixCustomifyPlugin()->get_typography_dynamic_style() );
|
222 |
remove_filter( 'customify_typography_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10 );
|
223 |
|
224 |
add_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 );
|
225 |
+
wp_add_inline_script( 'wp-editor', Customify_Font_Selector::instance()->get_fonts_dynamic_script() );
|
226 |
wp_add_inline_style( $enqueue_parent_handle, Customify_Font_Selector::instance()->get_fonts_dynamic_style() );
|
227 |
remove_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10 );
|
228 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: pixelgrade, euthelup, babbardel, vlad.olaru, raduconstantin, razva
|
|
3 |
Tags: customizer, css, editor, live, preview, customizer
|
4 |
Requires at least: 4.7.0
|
5 |
Tested up to: 5.0.0
|
6 |
-
Stable tag: 2.3.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
3 |
Tags: customizer, css, editor, live, preview, customizer
|
4 |
Requires at least: 4.7.0
|
5 |
Tested up to: 5.0.0
|
6 |
+
Stable tag: 2.3.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|