Google Fonts for WordPress - Version 2.0.5

Version Description

Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.5

changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 2.0.4 =
2
 
3
  * Update fonts list.
1
+ = 2.0.5 =
2
+
3
+ * Fix error notice in customizer.
4
+
5
  = 2.0.4 =
6
 
7
  * Update fonts list.
includes/customizer/controls/class-ogf-customize-multiple-checkbox-control.php CHANGED
@@ -51,6 +51,16 @@ class OGF_Customize_Multiple_Checkbox_Control extends WP_Customize_Control {
51
  $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
52
  }
53
  }
 
 
 
 
 
 
 
 
 
 
54
  /**
55
  * An Underscore (JS) template for this control's content (but not its container).
56
  *
@@ -85,4 +95,5 @@ class OGF_Customize_Multiple_Checkbox_Control extends WP_Customize_Control {
85
  </ul>
86
  <?php
87
  }
 
88
  }
51
  $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
52
  }
53
  }
54
+
55
+ /**
56
+ * Overwrite this method as we are rendering the template with JS.
57
+ *
58
+ * @access protected
59
+ * @since 1.0
60
+ * @return void
61
+ */
62
+ protected function render_content() {}
63
+
64
  /**
65
  * An Underscore (JS) template for this control's content (but not its container).
66
  *
95
  </ul>
96
  <?php
97
  }
98
+
99
  }
includes/customizer/controls/class-ogf-customize-multiple-fonts-control.php CHANGED
@@ -42,6 +42,15 @@ class OGF_Customize_Multiple_Fonts_Control extends WP_Customize_Control {
42
  $this->json['link'] = $this->get_link();
43
  }
44
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Underscore JS template to handle the control's output.
47
  */
42
  $this->json['link'] = $this->get_link();
43
  }
44
 
45
+ /**
46
+ * Overwrite this method as we are rendering the template with JS.
47
+ *
48
+ * @access protected
49
+ * @since 1.0
50
+ * @return void
51
+ */
52
+ protected function render_content() {}
53
+
54
  /**
55
  * Underscore JS template to handle the control's output.
56
  */
includes/customizer/controls/class-ogf-customize-typography-control.php CHANGED
@@ -85,6 +85,16 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
85
  }
86
  }
87
  }
 
 
 
 
 
 
 
 
 
 
88
  /**
89
  * Underscore JS template to handle the control's output.
90
  */
@@ -231,11 +241,9 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
231
  $new_variants['0'] = esc_html__( '- Default -', 'olympus-google-fonts' );
232
 
233
  foreach ( $variants as $key => $value ) {
234
- $new_variants[$key] = $all_variants[ $key ];
235
  }
236
 
237
-
238
-
239
  return $new_variants;
240
  }
241
 
85
  }
86
  }
87
  }
88
+
89
+ /**
90
+ * Overwrite this method as we are rendering the template with JS.
91
+ *
92
+ * @access protected
93
+ * @since 1.0
94
+ * @return void
95
+ */
96
+ protected function render_content() {}
97
+
98
  /**
99
  * Underscore JS template to handle the control's output.
100
  */
241
  $new_variants['0'] = esc_html__( '- Default -', 'olympus-google-fonts' );
242
 
243
  foreach ( $variants as $key => $value ) {
244
+ $new_variants[ $key ] = $all_variants[ $key ];
245
  }
246
 
 
 
247
  return $new_variants;
248
  }
249
 
includes/customizer/settings.php CHANGED
@@ -173,9 +173,16 @@ function ogf_customize_register( $wp_customize ) {
173
  return;
174
  }
175
 
176
- $weights = $fonts->get_font_weights( $font_id );
177
- $name = $fonts->get_font_name( $font_id );
178
- unset( $weights[0] );
 
 
 
 
 
 
 
179
  $wp_customize->add_setting(
180
  $font_id . '_weights',
181
  array(
@@ -199,7 +206,7 @@ function ogf_customize_register( $wp_customize ) {
199
  array(
200
  'label' => $name,
201
  'section' => 'ogf_font_loading',
202
- 'choices' => $weights,
203
  'input_attrs' => $input_attrs,
204
  )
205
  )
173
  return;
174
  }
175
 
176
+ $weights = $fonts->get_font_weights( $font_id );
177
+ $name = $fonts->get_font_name( $font_id );
178
+ $all_variants = ogf_font_variants();
179
+ $new_variants = array();
180
+ foreach ( $weights as $key => $value ) {
181
+ $new_variants[ $key ] = $all_variants[ $key ];
182
+ }
183
+ unset($new_variants[0]);
184
+
185
+
186
  $wp_customize->add_setting(
187
  $font_id . '_weights',
188
  array(
206
  array(
207
  'label' => $name,
208
  'section' => 'ogf_font_loading',
209
+ 'choices' => $new_variants,
210
  'input_attrs' => $input_attrs,
211
  )
212
  )
includes/functions.php CHANGED
@@ -287,16 +287,25 @@ function ogf_system_fonts() {
287
  */
288
  function ogf_font_variants() {
289
  return array(
290
- '0' => esc_html__( '- Default -', 'olympus-google-fonts' ),
291
- '100' => esc_html__( 'Thin', 'olympus-google-fonts' ),
292
- '200' => esc_html__( 'Extra Light', 'olympus-google-fonts' ),
293
- '300' => esc_html__( 'Light', 'olympus-google-fonts' ),
294
- '400' => esc_html__( 'Normal', 'olympus-google-fonts' ),
295
- '500' => esc_html__( 'Medium', 'olympus-google-fonts' ),
296
- '600' => esc_html__( 'Semi Bold', 'olympus-google-fonts' ),
297
- '700' => esc_html__( 'Bold', 'olympus-google-fonts' ),
298
- '800' => esc_html__( 'Extra Bold', 'olympus-google-fonts' ),
299
- '900' => esc_html__( 'Ultra Bold', 'olympus-google-fonts' ),
 
 
 
 
 
 
 
 
 
300
  );
301
  }
302
 
287
  */
288
  function ogf_font_variants() {
289
  return array(
290
+ '0' => esc_html__( '- Default -', 'olympus-google-fonts' ),
291
+ '100' => esc_html__( 'Thin', 'olympus-google-fonts' ),
292
+ '200' => esc_html__( 'Extra Light', 'olympus-google-fonts' ),
293
+ '300' => esc_html__( 'Light', 'olympus-google-fonts' ),
294
+ '400' => esc_html__( 'Normal', 'olympus-google-fonts' ),
295
+ '500' => esc_html__( 'Medium', 'olympus-google-fonts' ),
296
+ '600' => esc_html__( 'Semi Bold', 'olympus-google-fonts' ),
297
+ '700' => esc_html__( 'Bold', 'olympus-google-fonts' ),
298
+ '800' => esc_html__( 'Extra Bold', 'olympus-google-fonts' ),
299
+ '900' => esc_html__( 'Ultra Bold', 'olympus-google-fonts' ),
300
+ '100i' => esc_html__( 'Thin Italic', 'olympus-google-fonts' ),
301
+ '200i' => esc_html__( 'Extra Light Italic', 'olympus-google-fonts' ),
302
+ '300i' => esc_html__( 'Light Italic', 'olympus-google-fonts' ),
303
+ '400i' => esc_html__( 'Normal Italic', 'olympus-google-fonts' ),
304
+ '500i' => esc_html__( 'Medium Italic', 'olympus-google-fonts' ),
305
+ '600i' => esc_html__( 'Semi Bold Italic', 'olympus-google-fonts' ),
306
+ '700i' => esc_html__( 'Bold Italic', 'olympus-google-fonts' ),
307
+ '800i' => esc_html__( 'Extra Bold Italic', 'olympus-google-fonts' ),
308
+ '900i' => esc_html__( 'Ultra Bold Italic', 'olympus-google-fonts' ),
309
  );
310
  }
311
 
olympus-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: 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.0.4
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading
11
  * Text Domain: olympus-google-fonts
@@ -18,7 +18,7 @@
18
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
  */
20
 
21
- define( 'OGF_VERSION', '2.0.4' );
22
  define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
24
 
5
  * Plugin Name: 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.0.5
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading
11
  * Text Domain: olympus-google-fonts
18
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
  */
20
 
21
+ define( 'OGF_VERSION', '2.0.5' );
22
  define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
24
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://fontsplugin.com/#pricing
5
  Requires at least: 4.0
6
  Tested up to: 5.4
7
  License: GPLv2 or later
8
- Stable tag: 2.0.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.4
7
  License: GPLv2 or later
8
+ Stable tag: 2.0.5
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11