Google Fonts for WordPress - Version 2.3.5

Version Description

Download this release

Release Info

Developer DannyCooper
Plugin Icon 128x128 Google Fonts for WordPress
Version 2.3.5
Comparing to
See all releases

Code changes from version 2.3.4 to 2.3.5

changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 2.3.4 =
2
 
3
  * Improve CSS specificity
1
+ = 2.3.5 =
2
+
3
+ * Fix bug in Classic Editor when base fonts are not chosen
4
+
5
  = 2.3.4 =
6
 
7
  * Improve CSS specificity
includes/class-ogf-classic-editor.php CHANGED
@@ -73,24 +73,19 @@ if ( ! class_exists( 'OGF_Classic_Editor' ) ) :
73
 
74
  if ( ogf_is_custom_font( $base_type ) ) {
75
  $base_type = str_replace( 'cf-', '', $base_type );
76
- }
77
- if ( ogf_is_custom_font( $headings_type ) ) {
78
- $headings_type = str_replace( 'cf-', '', $headings_type );
79
- }
80
-
81
- if ( ogf_is_system_font( $base_type ) ) {
82
  $base_type = str_replace( 'sf-', '', $base_type );
83
  $base_type = $this->system_fonts[ $base_type ]['stack'];
 
 
84
  }
85
- if ( ogf_is_system_font( $headings_type ) ) {
 
 
 
86
  $headings_type = str_replace( 'sf-', '', $headings_type );
87
  $headings_type = $this->system_fonts[ $headings_type ]['stack'];
88
- }
89
-
90
- if ( ogf_is_google_font( $base_type ) ) {
91
- $base_type = $this->ogf_fonts->get_font_name( $base_type );
92
- }
93
- if ( ogf_is_google_font( $headings_type ) ) {
94
  $headings_type = $this->ogf_fonts->get_font_name( $headings_type );
95
  }
96
 
73
 
74
  if ( ogf_is_custom_font( $base_type ) ) {
75
  $base_type = str_replace( 'cf-', '', $base_type );
76
+ } elseif ( ogf_is_system_font( $base_type ) ) {
 
 
 
 
 
77
  $base_type = str_replace( 'sf-', '', $base_type );
78
  $base_type = $this->system_fonts[ $base_type ]['stack'];
79
+ } elseif ( ogf_is_google_font( $base_type ) ) {
80
+ $base_type = $this->ogf_fonts->get_font_name( $base_type );
81
  }
82
+
83
+ if ( ogf_is_custom_font( $headings_type ) ) {
84
+ $headings_type = str_replace( 'cf-', '', $headings_type );
85
+ } elseif ( ogf_is_system_font( $headings_type ) ) {
86
  $headings_type = str_replace( 'sf-', '', $headings_type );
87
  $headings_type = $this->system_fonts[ $headings_type ]['stack'];
88
+ } elseif ( ogf_is_google_font( $headings_type ) ) {
 
 
 
 
 
89
  $headings_type = $this->ogf_fonts->get_font_name( $headings_type );
90
  }
91
 
includes/customizer/settings.php CHANGED
@@ -190,7 +190,7 @@ function ogf_customize_register( $wp_customize ) {
190
  'ogf_font_display',
191
  array(
192
  'type' => 'select',
193
- 'section' => 'ogf_debugging', // Add a default or your own section
194
  'label' => __( 'Font Display' ),
195
  'choices' => array(
196
  'swap' => __( 'Swap', 'olympus-google-fonts' ),
190
  'ogf_font_display',
191
  array(
192
  'type' => 'select',
193
+ 'section' => 'ogf_debugging',
194
  'label' => __( 'Font Display' ),
195
  'choices' => array(
196
  'swap' => __( 'Swap', 'olympus-google-fonts' ),
includes/functions.php CHANGED
@@ -169,6 +169,15 @@ function ogf_fonts_array() {
169
  '700italic',
170
  '800italic',
171
  '900italic',
 
 
 
 
 
 
 
 
 
172
  );
173
 
174
  // remove italic variants.
@@ -321,6 +330,11 @@ function ogf_font_variants() {
321
  * @param string $font_id The ID of the font to check.
322
  */
323
  function ogf_is_system_font( $font_id ) {
 
 
 
 
 
324
  if ( strpos( $font_id, 'sf-' ) === 0 ) {
325
  return true;
326
  }
@@ -333,6 +347,11 @@ function ogf_is_system_font( $font_id ) {
333
  * @param string $font_id The ID of the font to check.
334
  */
335
  function ogf_is_custom_font( $font_id ) {
 
 
 
 
 
336
  if ( strpos( $font_id, 'cf-' ) === 0 ) {
337
  return true;
338
  }
@@ -345,6 +364,11 @@ function ogf_is_custom_font( $font_id ) {
345
  * @param string $font_id The ID of the font to check.
346
  */
347
  function ogf_is_google_font( $font_id ) {
 
 
 
 
 
348
  if ( array_key_exists( $font_id, OGF_Fonts::$google_fonts ) ) {
349
  return true;
350
  }
169
  '700italic',
170
  '800italic',
171
  '900italic',
172
+ '100i',
173
+ '200i',
174
+ '300i',
175
+ '400i',
176
+ '500i',
177
+ '600i',
178
+ '700i',
179
+ '800i',
180
+ '900i',
181
  );
182
 
183
  // remove italic variants.
330
  * @param string $font_id The ID of the font to check.
331
  */
332
  function ogf_is_system_font( $font_id ) {
333
+
334
+ if ( ! is_string( $font_id ) ) {
335
+ return;
336
+ }
337
+
338
  if ( strpos( $font_id, 'sf-' ) === 0 ) {
339
  return true;
340
  }
347
  * @param string $font_id The ID of the font to check.
348
  */
349
  function ogf_is_custom_font( $font_id ) {
350
+
351
+ if ( ! is_string( $font_id ) ) {
352
+ return;
353
+ }
354
+
355
  if ( strpos( $font_id, 'cf-' ) === 0 ) {
356
  return true;
357
  }
364
  * @param string $font_id The ID of the font to check.
365
  */
366
  function ogf_is_google_font( $font_id ) {
367
+
368
+ if ( ! is_string( $font_id ) ) {
369
+ return;
370
+ }
371
+
372
  if ( array_key_exists( $font_id, OGF_Fonts::$google_fonts ) ) {
373
  return true;
374
  }
olympus-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: Fonts Plugin | Google Fonts Typography
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts typography plugin. No coding required. 900+ font choices.
8
- * Version: 2.3.4
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description
11
  * Text Domain: olympus-google-fonts
@@ -19,7 +19,7 @@
19
  */
20
 
21
  if ( ! defined( 'OGF_VERSION' ) ) {
22
- define( 'OGF_VERSION', '2.3.4' );
23
  }
24
 
25
  if ( ! defined( 'OGF_DIR_PATH' ) ) {
5
  * Plugin Name: Fonts Plugin | Google Fonts Typography
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts typography plugin. No coding required. 900+ font choices.
8
+ * Version: 2.3.5
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description
11
  * Text Domain: olympus-google-fonts
19
  */
20
 
21
  if ( ! defined( 'OGF_VERSION' ) ) {
22
+ define( 'OGF_VERSION', '2.3.5' );
23
  }
24
 
25
  if ( ! defined( 'OGF_DIR_PATH' ) ) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://fontsplugin.com/#pricing
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
  License: GPLv2 or later
8
- Stable tag: 2.3.4
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11
 
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
  License: GPLv2 or later
8
+ Stable tag: 2.3.5
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11