Google Fonts for WordPress - Version 2.1.1

Version Description

Download this release

Release Info

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

Code changes from version 2.1.0 to 2.1.1

assets/js/customize-controls.js CHANGED
@@ -33,22 +33,47 @@
33
  function() {
34
  const value = jQuery( this ).val();
35
  control.settings.family.set( value );
36
- if ( value !== 'default' && ! isSystemFont( value ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  addGoogleFont( value );
38
 
39
  const font = ogf_font_array[ value ];
40
- const weightsSelect = jQuery( '.typography-font-weight select' );
41
  const newWeights = font.v;
 
42
 
43
  // remove variants the font doesn't support.
44
- for (const property in ogf_font_variants) {
45
- if ( property != 0 && typeof( newWeights[property] ) == "undefined" ) delete ogf_font_variants[property];
 
46
  }
47
 
48
  // replace the 'Font Weight' select field values.
 
49
  weightsSelect.empty();
50
  jQuery.each(
51
- ogf_font_variants,
52
  function( key, val ) {
53
  weightsSelect.append(
54
  jQuery( '<option></option>' )
33
  function() {
34
  const value = jQuery( this ).val();
35
  control.settings.family.set( value );
36
+ const weightsSelect = jQuery( '.typography-font-weight select' );
37
+
38
+ if ( value === 'default' || isSystemFont( value ) ) {
39
+
40
+ const defaultWeights = {
41
+ 0: "- Default -",
42
+ 400: "Normal",
43
+ 700: "Bold",
44
+ }
45
+
46
+ // replace the 'Font Weight' select field values.
47
+ weightsSelect.empty();
48
+ jQuery.each(
49
+ defaultWeights,
50
+ function( key, val ) {
51
+ weightsSelect.append(
52
+ jQuery( '<option></option>' )
53
+ .attr( 'value', key ).text( val )
54
+ );
55
+ }
56
+ );
57
+
58
+ } else {
59
+ // Add Google Font enqueue to head of customizer.
60
  addGoogleFont( value );
61
 
62
  const font = ogf_font_array[ value ];
 
63
  const newWeights = font.v;
64
+ newWeights[0] = "0";
65
 
66
  // remove variants the font doesn't support.
67
+ var finalWeights = new Object();
68
+ for( var i in newWeights ) {
69
+ finalWeights[i] = ogf_font_variants[i];
70
  }
71
 
72
  // replace the 'Font Weight' select field values.
73
+ const weightsSelect = jQuery( '.typography-font-weight select' );
74
  weightsSelect.empty();
75
  jQuery.each(
76
+ finalWeights,
77
  function( key, val ) {
78
  weightsSelect.append(
79
  jQuery( '<option></option>' )
changelog.txt CHANGED
@@ -1,7 +1,11 @@
 
 
 
 
1
  = 2.1.0 =
2
 
3
- * Further optimize fonts.json
4
- * Update fonts list
5
 
6
  = 2.0.7 =
7
 
@@ -9,7 +13,7 @@
9
 
10
  = 2.0.6 =
11
 
12
- * Output the 'Basic Setting' choices as CSS variables. props @helgatheviking
13
  * Fix issue where important wasn't being applied to some system fonts.
14
  * Add welcome page.
15
 
1
+ = 2.1.1 =
2
+
3
+ * Fix issue where customizer wasn't loading correct font weights.
4
+
5
  = 2.1.0 =
6
 
7
+ * Further optimize fonts.json.
8
+ * Update fonts list.
9
 
10
  = 2.0.7 =
11
 
13
 
14
  = 2.0.6 =
15
 
16
+ * Output the 'Basic Setting' choices as CSS variables. props @helgatheviking.
17
  * Fix issue where important wasn't being applied to some system fonts.
18
  * Add welcome page.
19
 
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.1.0
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.1.0' );
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.1.1
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.1.1' );
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.1.0
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.1.1
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11