Changeset 2009195
- Timestamp:
- 01/09/2019 03:21:04 PM (7 years ago)
- Location:
- customify/trunk
- Files:
-
- 4 edited
-
class-pixcustomify.php (modified) (1 diff)
-
customify.php (modified) (3 diffs)
-
features/class-Font_Selector.php (modified) (4 diffs)
-
includes/class-customify-gutenberg.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
customify/trunk/class-pixcustomify.php
r1990988 r2009195 938 938 ob_start(); 939 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 } 963 <?php 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 964 963 $output = ob_get_clean(); 965 964 } -
customify/trunk/customify.php
r1990988 r2009195 4 4 Plugin URI: https://wordpress.org/plugins/customify/ 5 5 Description: A Theme Customizer Booster 6 Version: 2.3. 26 Version: 2.3.3 7 7 Author: Pixelgrade 8 8 Author URI: https://pixelgrade.com … … 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 13 13 Domain Path: /languages/ 14 Requires at least: 4.9 15 Tested up to: 5.0.2 14 16 */ 15 17 … … 62 64 require_once plugin_dir_path( __FILE__ ) . 'class-pixcustomify.php'; 63 65 64 $instance = PixCustomifyPlugin::instance( __FILE__, '2.3. 2' );66 $instance = PixCustomifyPlugin::instance( __FILE__, '2.3.3' ); 65 67 66 68 return $instance; -
customify/trunk/features/class-Font_Selector.php
r1987686 r2009195 110 110 if ( ! empty( $font ) ) { 111 111 //display the select option's HTML 112 Pix_Customize_Font_Control::output_font_option( $font ['family'], $active_font_family, $font, 'theme_font' );112 Pix_Customize_Font_Control::output_font_option( $font, $active_font_family, 'theme_font' ); 113 113 } 114 114 } … … 177 177 } 178 178 179 if ( isset( $value['font_family'] ) && isset( $value['type'] ) && $value['type'] === 'google' ) { 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' ) { 180 193 $family = "'" . $value['font_family']; 181 194 … … 213 226 214 227 $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 228 } 229 229 } … … 515 515 } 516 516 517 ob_start(); 518 ?> 519 var customify_font_loader = function () { 520 var webfontargs = { 521 classes: false, 522 events: false 523 }; 524 <?php if ( ! empty( $args['google_families'] ) ) { ?> 525 webfontargs.google = {families: [<?php echo join( ',', $args['google_families'] ); ?>]}; 526 <?php } 527 if ( ! empty( $args['local_families'] ) && ! empty( $args['local_srcs'] ) ) { ?> 528 webfontargs.custom = { 529 families: [<?php echo join( ',', $args['local_families'] ); ?>], 530 urls: [<?php echo join( ',', $args['local_srcs'] ) ?>] 531 }; 532 <?php } ?> 533 WebFont.load(webfontargs); 534 }; 535 536 if (typeof WebFont !== 'undefined') { <?php // if there is a WebFont object, use it ?> 537 customify_font_loader(); 538 } else { <?php // basically when we don't have the WebFont object we create the google script dynamically ?> 539 var tk = document.createElement('script'); 540 tk.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; 541 tk.type = 'text/javascript'; 542 543 tk.onload = tk.onreadystatechange = function () { 544 customify_font_loader(); 545 }; 546 var s = document.getElementsByTagName('script')[0]; 547 s.parentNode.insertBefore(tk, s); 548 } 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 } 549 551 <?php 550 552 $output = ob_get_clean(); -
customify/trunk/includes/class-customify-gutenberg.php
r1985364 r2009195 218 218 if ( PixCustomifyPlugin()->get_plugin_setting( 'enable_editor_style', true ) ) { 219 219 add_filter( 'customify_typography_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 ); 220 wp_add_inline_script( $enqueue_parent_handle, PixCustomifyPlugin()->get_typography_dynamic_script() );220 wp_add_inline_script( 'wp-editor', PixCustomifyPlugin()->get_typography_dynamic_script() ); 221 221 wp_add_inline_style( $enqueue_parent_handle, PixCustomifyPlugin()->get_typography_dynamic_style() ); 222 222 remove_filter( 'customify_typography_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10 ); 223 223 224 224 add_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 ); 225 wp_add_inline_script( $enqueue_parent_handle, Customify_Font_Selector::instance()->get_fonts_dynamic_script() );225 wp_add_inline_script( 'wp-editor', Customify_Font_Selector::instance()->get_fonts_dynamic_script() ); 226 226 wp_add_inline_style( $enqueue_parent_handle, Customify_Font_Selector::instance()->get_fonts_dynamic_style() ); 227 227 remove_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10 );
Note: See TracChangeset
for help on using the changeset viewer.