Google Fonts for WordPress - Version 3.2.0

Version Description

Download this release

Release Info

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

Code changes from version 3.1.2 to 3.2.0

assets/css/customize-controls.css CHANGED
@@ -1,5 +1,11 @@
1
  #customize-theme-controls #sub-accordion-section-ogf_basic,
2
  #customize-theme-controls #sub-accordion-section-ogf_theme,
 
 
 
 
 
 
3
  #customize-theme-controls #sub-accordion-section-ogf_custom,
4
  #customize-theme-controls #sub-accordion-section-ogf_advanced__branding,
5
  #customize-theme-controls #sub-accordion-section-ogf_advanced__navigation,
1
  #customize-theme-controls #sub-accordion-section-ogf_basic,
2
  #customize-theme-controls #sub-accordion-section-ogf_theme,
3
+ #customize-theme-controls #sub-accordion-section-ogf_woocommerce,
4
+ #customize-theme-controls #sub-accordion-section-ogf_wc_shop,
5
+ #customize-theme-controls #sub-accordion-section-ogf_wc_single,
6
+ #customize-theme-controls #sub-accordion-section-ogf_wc_block,
7
+ #customize-theme-controls #sub-accordion-section-ogf_wc_cart,
8
+ #customize-theme-controls #sub-accordion-section-ogf_wc_checkout,
9
  #customize-theme-controls #sub-accordion-section-ogf_custom,
10
  #customize-theme-controls #sub-accordion-section-ogf_advanced__branding,
11
  #customize-theme-controls #sub-accordion-section-ogf_advanced__navigation,
changelog.txt CHANGED
@@ -1,10 +1,14 @@
 
 
 
 
1
  = 3.1.2 =
2
 
3
- * Automatically add all custom uploaded and typekit/adobe fonts to the Classic Editor
4
 
5
  = 3.0.21 =
6
 
7
- * Improve compatability with Full Site Editing (FSE)
8
 
9
  = 3.0.20 =
10
 
1
+ = 3.2.0 =
2
+
3
+ * Add WooCommerce support.
4
+
5
  = 3.1.2 =
6
 
7
+ * Automatically add all custom uploaded and typekit/adobe fonts to the Classic Editor.
8
 
9
  = 3.0.21 =
10
 
11
+ * Improve compatibility with Full Site Editing (FSE).
12
 
13
  = 3.0.20 =
14
 
class-olympus-google-fonts.php CHANGED
@@ -39,7 +39,7 @@ class Olympus_Google_Fonts {
39
  */
40
  public function constants() {
41
  if ( ! defined( 'OGF_VERSION' ) ) {
42
- define( 'OGF_VERSION', '3.1.2' );
43
  }
44
 
45
  if ( ! defined( 'OGF_DIR_PATH' ) ) {
@@ -105,6 +105,9 @@ class Olympus_Google_Fonts {
105
  if ( file_exists( $author_compat_path ) ) {
106
  require_once $author_compat_path;
107
  }
 
 
 
108
  }
109
 
110
  /**
39
  */
40
  public function constants() {
41
  if ( ! defined( 'OGF_VERSION' ) ) {
42
+ define( 'OGF_VERSION', '3.2.0' );
43
  }
44
 
45
  if ( ! defined( 'OGF_DIR_PATH' ) ) {
105
  if ( file_exists( $author_compat_path ) ) {
106
  require_once $author_compat_path;
107
  }
108
+ if ( is_woocommerce_activated() ) {
109
+ require_once OGF_DIR_PATH . '/compatibility/woocommerce.php';
110
+ }
111
  }
112
 
113
  /**
compatibility/woocommerce.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Compatibility file for WooCommerce.
4
+ *
5
+ * @package olympus-google-fonts
6
+ * @copyright Copyright (c) 2020, Fonts Plugin
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ */
9
+
10
+ /**
11
+ * Modify the default element selectors to improve compatibility with WooCommerce.
12
+ *
13
+ * @param array $elements The default elements.
14
+ */
15
+ function ogf_woocommerce_controls( $elements ) {
16
+
17
+ $new = array(
18
+ 'ogc_wc_single_title' => array(
19
+ 'label' => esc_html__( 'Product Title', 'olympus-google-fonts' ),
20
+ 'description' => '',
21
+ 'section' => 'ogf_wc_single',
22
+ 'selectors' => '.product_title',
23
+ ),
24
+ 'ogc_wc_single_short_desc' => array(
25
+ 'label' => esc_html__( 'Short Description', 'olympus-google-fonts' ),
26
+ 'description' => '',
27
+ 'section' => 'ogf_wc_single',
28
+ 'selectors' => '.woocommerce-product-details__short-description',
29
+ ),
30
+ 'ogc_wc_single_price' => array(
31
+ 'label' => esc_html__( 'Price', 'olympus-google-fonts' ),
32
+ 'description' => '',
33
+ 'section' => 'ogf_wc_single',
34
+ 'selectors' => '.single-product .price',
35
+ ),
36
+ 'ogc_wc_single_price_add_to_cart' => array(
37
+ 'label' => esc_html__( 'Add to Cart Button', 'olympus-google-fonts' ),
38
+ 'description' => '',
39
+ 'section' => 'ogf_wc_single',
40
+ 'selectors' => '.single_add_to_cart_button',
41
+ ),
42
+ 'ogc_wc_single_tab_headings' => array(
43
+ 'label' => esc_html__( 'Tab Headings', 'olympus-google-fonts' ),
44
+ 'description' => '',
45
+ 'section' => 'ogf_wc_single',
46
+ 'selectors' => '.wc-tab h2',
47
+ ),
48
+ 'ogc_wc_single_tab_content' => array(
49
+ 'label' => esc_html__( 'Tab Content', 'olympus-google-fonts' ),
50
+ 'description' => '',
51
+ 'section' => 'ogf_wc_single',
52
+ 'selectors' => '.wc-tab p',
53
+ ),
54
+ 'ogf_wc_checkout_button' => array(
55
+ 'label' => esc_html__( 'Proceed to Checkout Button', 'olympus-google-fonts' ),
56
+ 'description' => '',
57
+ 'section' => 'ogf_wc_cart',
58
+ 'selectors' => '.checkout-button',
59
+ ),
60
+ 'ogf_wc_field_labels' => array(
61
+ 'label' => esc_html__( 'Field Labels', 'olympus-google-fonts' ),
62
+ 'description' => '',
63
+ 'section' => 'ogf_wc_checkout',
64
+ 'selectors' => '.woocommerce .form-row label',
65
+ ),
66
+ 'ogf_wc_order_button' => array(
67
+ 'label' => esc_html__( 'Place Order Button', 'olympus-google-fonts' ),
68
+ 'description' => '',
69
+ 'section' => 'ogf_wc_checkout',
70
+ 'selectors' => '#place_order',
71
+ ),
72
+ 'ogf_wc_block_name' => array(
73
+ 'label' => esc_html__( 'Product Title', 'olympus-google-fonts' ),
74
+ 'description' => '',
75
+ 'section' => 'ogf_wc_block',
76
+ 'selectors' => '.wc-block-grid__products .wc-block-grid__product .wc-block-components-product-name',
77
+ ),
78
+ 'ogf_wc_block_price' => array(
79
+ 'label' => esc_html__( 'Product Price', 'olympus-google-fonts' ),
80
+ 'description' => '',
81
+ 'section' => 'ogf_wc_block',
82
+ 'selectors' => '.wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-price',
83
+ ),
84
+ 'ogf_wc_block_button' => array(
85
+ 'label' => esc_html__( 'Add to Cart Button', 'olympus-google-fonts' ),
86
+ 'description' => '',
87
+ 'section' => 'ogf_wc_block',
88
+ 'selectors' => '.wc-block-grid__products .wc-block-grid__product .add_to_cart_button',
89
+ ),
90
+ 'ogf_wc_shop_name' => array(
91
+ 'label' => esc_html__( 'Product Title', 'olympus-google-fonts' ),
92
+ 'description' => '',
93
+ 'section' => 'ogf_wc_shop',
94
+ 'selectors' => 'ul.products li.product .woocommerce-loop-product__title',
95
+ ),
96
+ 'ogf_wc_shop_price' => array(
97
+ 'label' => esc_html__( 'Product Price', 'olympus-google-fonts' ),
98
+ 'description' => '',
99
+ 'section' => 'ogf_wc_shop',
100
+ 'selectors' => 'ul.products li.product .price',
101
+ ),
102
+ 'ogf_wc_shop_button' => array(
103
+ 'label' => esc_html__( 'Add to Cart Button', 'olympus-google-fonts' ),
104
+ 'description' => '',
105
+ 'section' => 'ogf_wc_shop',
106
+ 'selectors' => 'ul.products li.product .button',
107
+ ),
108
+ );
109
+
110
+ return array_merge( $elements, $new );
111
+
112
+ };
113
+
114
+ add_filter( 'ogf_elements', 'ogf_woocommerce_controls' );
includes/customizer/panels.php CHANGED
@@ -38,7 +38,6 @@ function ogf_panels_customize_register( $wp_customize ) {
38
  'ogf_theme',
39
  array(
40
  'title' => esc_html__( 'Theme Settings', 'olympus-google-fonts' ),
41
- 'priority' => '1',
42
  'panel' => 'ogf_google_fonts',
43
  )
44
  );
@@ -47,7 +46,6 @@ function ogf_panels_customize_register( $wp_customize ) {
47
  'ogf_basic',
48
  array(
49
  'title' => __( 'Basic Settings', 'olympus-google-fonts' ),
50
- 'priority' => '2',
51
  'panel' => 'ogf_google_fonts',
52
  )
53
  );
@@ -57,7 +55,6 @@ function ogf_panels_customize_register( $wp_customize ) {
57
  'ogf_advanced',
58
  array(
59
  'title' => __( 'Advanced Settings', 'olympus-google-fonts' ),
60
- 'priority' => '3',
61
  'panel' => 'ogf_google_fonts',
62
  )
63
  );
@@ -68,7 +65,6 @@ function ogf_panels_customize_register( $wp_customize ) {
68
  'ogf_custom',
69
  array(
70
  'title' => esc_html__( 'Custom Elements', 'olympus-google-fonts' ),
71
- 'priority' => '5',
72
  /* Translators: %s Custom Elements Customizer Panel URL */
73
  'description' => sprintf( __( 'Define your Custom Elements here and then customize them under <a href="%s">Advanced Settings &rarr; Custom Elements</a>.', 'olympus-google-fonts' ), esc_url( admin_url( '/customize.php?autofocus[section]=ogf_advanced__custom' ) ) ),
74
  'panel' => 'ogf_google_fonts',
@@ -79,7 +75,6 @@ function ogf_panels_customize_register( $wp_customize ) {
79
  'ogf_font_loading',
80
  array(
81
  'title' => esc_html__( 'Font Loading', 'olympus-google-fonts' ),
82
- 'priority' => '6',
83
  'description' => 'Optimize your site\'s performance by unchecking any font weights you don\'t need.',
84
  'panel' => 'ogf_google_fonts',
85
  )
@@ -89,7 +84,6 @@ function ogf_panels_customize_register( $wp_customize ) {
89
  'ogf_debugging',
90
  array(
91
  'title' => esc_html__( 'Debugging', 'olympus-google-fonts' ),
92
- 'priority' => '8',
93
  'panel' => 'ogf_google_fonts',
94
  )
95
  );
@@ -159,5 +153,55 @@ function ogf_panels_customize_register( $wp_customize ) {
159
  'panel' => 'ogf_advanced',
160
  )
161
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
163
  add_action( 'customize_register', 'ogf_panels_customize_register' );
38
  'ogf_theme',
39
  array(
40
  'title' => esc_html__( 'Theme Settings', 'olympus-google-fonts' ),
 
41
  'panel' => 'ogf_google_fonts',
42
  )
43
  );
46
  'ogf_basic',
47
  array(
48
  'title' => __( 'Basic Settings', 'olympus-google-fonts' ),
 
49
  'panel' => 'ogf_google_fonts',
50
  )
51
  );
55
  'ogf_advanced',
56
  array(
57
  'title' => __( 'Advanced Settings', 'olympus-google-fonts' ),
 
58
  'panel' => 'ogf_google_fonts',
59
  )
60
  );
65
  'ogf_custom',
66
  array(
67
  'title' => esc_html__( 'Custom Elements', 'olympus-google-fonts' ),
 
68
  /* Translators: %s Custom Elements Customizer Panel URL */
69
  'description' => sprintf( __( 'Define your Custom Elements here and then customize them under <a href="%s">Advanced Settings &rarr; Custom Elements</a>.', 'olympus-google-fonts' ), esc_url( admin_url( '/customize.php?autofocus[section]=ogf_advanced__custom' ) ) ),
70
  'panel' => 'ogf_google_fonts',
75
  'ogf_font_loading',
76
  array(
77
  'title' => esc_html__( 'Font Loading', 'olympus-google-fonts' ),
 
78
  'description' => 'Optimize your site\'s performance by unchecking any font weights you don\'t need.',
79
  'panel' => 'ogf_google_fonts',
80
  )
84
  'ogf_debugging',
85
  array(
86
  'title' => esc_html__( 'Debugging', 'olympus-google-fonts' ),
 
87
  'panel' => 'ogf_google_fonts',
88
  )
89
  );
153
  'panel' => 'ogf_advanced',
154
  )
155
  );
156
+
157
+ if ( is_woocommerce_activated() ) {
158
+
159
+ $ogf_woocommerce_panel = new OGF_Customize_Panel(
160
+ $wp_customize,
161
+ 'ogf_woocommerce',
162
+ array(
163
+ 'title' => __( 'WooCommerce', 'olympus-google-fonts' ),
164
+ 'panel' => 'ogf_google_fonts',
165
+ )
166
+ );
167
+
168
+ $wp_customize->add_panel( $ogf_woocommerce_panel );
169
+
170
+ $wp_customize->add_section(
171
+ 'ogf_wc_shop',
172
+ array(
173
+ 'title' => esc_html__( 'WooCommerce Shop Page', 'olympus-google-fonts' ),
174
+ 'panel' => 'ogf_woocommerce',
175
+ )
176
+ );
177
+ $wp_customize->add_section(
178
+ 'ogf_wc_single',
179
+ array(
180
+ 'title' => esc_html__( 'WooCommerce Single Product', 'olympus-google-fonts' ),
181
+ 'panel' => 'ogf_woocommerce',
182
+ )
183
+ );
184
+ $wp_customize->add_section(
185
+ 'ogf_wc_block',
186
+ array(
187
+ 'title' => esc_html__( 'WooCommerce Blocks', 'olympus-google-fonts' ),
188
+ 'panel' => 'ogf_woocommerce',
189
+ )
190
+ );
191
+ $wp_customize->add_section(
192
+ 'ogf_wc_cart',
193
+ array(
194
+ 'title' => esc_html__( 'WooCommerce Cart', 'olympus-google-fonts' ),
195
+ 'panel' => 'ogf_woocommerce',
196
+ )
197
+ );
198
+ $wp_customize->add_section(
199
+ 'ogf_wc_checkout',
200
+ array(
201
+ 'title' => esc_html__( 'WooCommerce Checkout', 'olympus-google-fonts' ),
202
+ 'panel' => 'ogf_woocommerce',
203
+ )
204
+ );
205
+ }
206
  }
207
  add_action( 'customize_register', 'ogf_panels_customize_register' );
includes/functions.php CHANGED
@@ -63,7 +63,7 @@ function ogf_get_elements() {
63
  'label' => esc_html__( 'Site Description Typography', 'olympus-google-fonts' ),
64
  'description' => esc_html__( 'Select and configure the font for your site description.', 'olympus-google-fonts' ),
65
  'section' => 'ogf_advanced__branding',
66
- 'selectors' => '#site-description, .site-description',
67
  ),
68
  'ogf_site_navigation' => array(
69
  'label' => esc_html__( 'Navigation Typography', 'olympus-google-fonts' ),
@@ -75,7 +75,7 @@ function ogf_get_elements() {
75
  'label' => esc_html__( 'Content Typography', 'olympus-google-fonts' ),
76
  'description' => esc_html__( 'Select and configure the font for your post and page content.', 'olympus-google-fonts' ),
77
  'section' => 'ogf_advanced__content',
78
- 'selectors' => '.entry-content, .entry-content p, .post-content, .page-content, .post-excerpt, .entry-summary, .entry-excerpt, .excerpt, .excerpt p, .type-post p, .type-page p',
79
  ),
80
  'ogf_post_page_h1' => array(
81
  'label' => esc_html__( 'Title and H1 Typography', 'olympus-google-fonts' ),
@@ -406,3 +406,12 @@ function ogf_is_google_font( $font_id ) {
406
 
407
  return false;
408
  }
 
 
 
 
 
 
 
 
 
63
  'label' => esc_html__( 'Site Description Typography', 'olympus-google-fonts' ),
64
  'description' => esc_html__( 'Select and configure the font for your site description.', 'olympus-google-fonts' ),
65
  'section' => 'ogf_advanced__branding',
66
+ 'selectors' => '#site-description, .site-description, #site-tagline, .site-tagline, .wp-block-site-tagline',
67
  ),
68
  'ogf_site_navigation' => array(
69
  'label' => esc_html__( 'Navigation Typography', 'olympus-google-fonts' ),
75
  'label' => esc_html__( 'Content Typography', 'olympus-google-fonts' ),
76
  'description' => esc_html__( 'Select and configure the font for your post and page content.', 'olympus-google-fonts' ),
77
  'section' => 'ogf_advanced__content',
78
+ 'selectors' => '.entry-content, .entry-content p, .post-content, .page-content, .post-excerpt, .entry-summary, .entry-excerpt, .excerpt, .excerpt p, .type-post p, .type-page p, .wp-block-post-content, .wp-block-post-excerpt',
79
  ),
80
  'ogf_post_page_h1' => array(
81
  'label' => esc_html__( 'Title and H1 Typography', 'olympus-google-fonts' ),
406
 
407
  return false;
408
  }
409
+
410
+ /**
411
+ * Check if WooCommerce is activated
412
+ */
413
+ if ( ! function_exists( 'is_woocommerce_activated' ) ) {
414
+ function is_woocommerce_activated() {
415
+ if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
416
+ }
417
+ }
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 Plugin. No coding required. Optimized for Speed. 1000+ font choices.
8
- * Version: 3.1.2
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
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 Plugin. No coding required. Optimized for Speed. 1000+ font choices.
8
+ * Version: 3.2.0
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
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Fonts Plugin | Google Fonts Typography ===
2
  Contributors: DannyCooper, googlefonts, fontsplugin
3
- Tags: google, fonts, google fonts, typekit, elementor, adobe fonts, typography, upload fonts, custom fonts, preloading, customizer, font size, font color, design
4
  Donate link: https://fontsplugin.com/#pricing
5
  Requires at least: 4.0
6
  Tested up to: 6.0
7
  License: GPLv2 or later
8
- Stable tag: 3.1.2
9
 
10
  The easiest to use Google Fonts Plugin. No coding required. Optimized for Speed. 1000+ font choices.
11
 
@@ -27,6 +27,7 @@ The full Google Fonts library can be found here - [Google Fonts](https://fonts.g
27
  * **Adobe Fonts (Typekit)** integration.
28
  * Works with any WordPress Theme. No coding required.
29
  * Easy One-Click Updates.
 
30
  * Translation Ready.
31
  * SSL and HTTPS compatible.
32
  * Efficient Font Loading using a single request.
1
  === Fonts Plugin | Google Fonts Typography ===
2
  Contributors: DannyCooper, googlefonts, fontsplugin
3
+ Tags: google, fonts, google fonts, typekit, elementor, adobe fonts, typography, upload fonts, custom fonts, preloading, customizer, font size, font color, design, woocommerce
4
  Donate link: https://fontsplugin.com/#pricing
5
  Requires at least: 4.0
6
  Tested up to: 6.0
7
  License: GPLv2 or later
8
+ Stable tag: 3.2.0
9
 
10
  The easiest to use Google Fonts Plugin. No coding required. Optimized for Speed. 1000+ font choices.
11
 
27
  * **Adobe Fonts (Typekit)** integration.
28
  * Works with any WordPress Theme. No coding required.
29
  * Easy One-Click Updates.
30
+ * WooCommerce support.
31
  * Translation Ready.
32
  * SSL and HTTPS compatible.
33
  * Efficient Font Loading using a single request.