Google Fonts for WordPress - Version 1.7.2

Version Description

Download this release

Release Info

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

Code changes from version 1.7.1 to 1.7.2

assets/js/customize-controls.js CHANGED
@@ -21,6 +21,13 @@
21
  wp.customize.previewer.send( 'olympusFontURL', '<link href=\'https://fonts.googleapis.com/css?family=' + fontURL + '\' rel=\'stylesheet\' type=\'text/css\'>' );
22
  }
23
 
 
 
 
 
 
 
 
24
  // Load the font-weights for the newly selected font.
25
  control.container.on(
26
  'change',
@@ -28,7 +35,7 @@
28
  function() {
29
  const value = jQuery( this ).val();
30
  control.settings.family.set( value );
31
- if ( value !== 'default' ) {
32
  addGoogleFont( value );
33
 
34
  const font = ogf_font_array[ value ];
21
  wp.customize.previewer.send( 'olympusFontURL', '<link href=\'https://fonts.googleapis.com/css?family=' + fontURL + '\' rel=\'stylesheet\' type=\'text/css\'>' );
22
  }
23
 
24
+ function isSystemFont( fontID ) {
25
+ if ( fontID.indexOf( 'sf-' ) !== -1 ) {
26
+ return true;
27
+ }
28
+ return false;
29
+ }
30
+
31
  // Load the font-weights for the newly selected font.
32
  control.container.on(
33
  'change',
35
  function() {
36
  const value = jQuery( this ).val();
37
  control.settings.family.set( value );
38
+ if ( value !== 'default' && ! isSystemFont( value ) ) {
39
  addGoogleFont( value );
40
 
41
  const font = ogf_font_array[ value ];
assets/js/customize-preview.js CHANGED
@@ -1,6 +1,6 @@
1
  'use strict';
2
 
3
- /* global ogf_elements */
4
  jQuery( document ).ready(
5
  function() {
6
  // Retrieve the Google Fonts url from the Customizer and append it to head.
@@ -16,6 +16,11 @@ jQuery( document ).ready(
16
  if ( value === 'default' ) {
17
  jQuery( selector ).css( 'font-family', '' );
18
  wp.customize.preview.send( 'refresh' );
 
 
 
 
 
19
  } else {
20
  jQuery( selector ).each( function( i, v ) {
21
  v.style.setProperty( 'font-family', '"' + value.split( '-' ).join( ' ' ) + '"', 'important' );
@@ -23,6 +28,13 @@ jQuery( document ).ready(
23
  }
24
  }
25
 
 
 
 
 
 
 
 
26
  // Loop through the elements and bind the controls.
27
  jQuery.map( ogf_elements, function( val, id ) {
28
  wp.customize(
1
  'use strict';
2
 
3
+ /* global ogf_elements, ogf_system_fonts */
4
  jQuery( document ).ready(
5
  function() {
6
  // Retrieve the Google Fonts url from the Customizer and append it to head.
16
  if ( value === 'default' ) {
17
  jQuery( selector ).css( 'font-family', '' );
18
  wp.customize.preview.send( 'refresh' );
19
+ } else if ( isSystemFont( value ) ) {
20
+ jQuery( selector ).each( function( i, v ) {
21
+ const fontID = value.replace( 'sf-', '' );
22
+ v.style.setProperty( 'font-family', ogf_system_fonts[ fontID ].stack, 'important' );
23
+ } );
24
  } else {
25
  jQuery( selector ).each( function( i, v ) {
26
  v.style.setProperty( 'font-family', '"' + value.split( '-' ).join( ' ' ) + '"', 'important' );
28
  }
29
  }
30
 
31
+ function isSystemFont( fontID ) {
32
+ if ( fontID.indexOf( 'sf-' ) !== -1 ) {
33
+ return true;
34
+ }
35
+ return false;
36
+ }
37
+
38
  // Loop through the elements and bind the controls.
39
  jQuery.map( ogf_elements, function( val, id ) {
40
  wp.customize(
assets/js/deactivation.js CHANGED
@@ -10,6 +10,7 @@ jQuery( document ).ready(
10
  '<p>We\'re sorry our Google Fonts plugin didn\'t work for you. Would you mind letting us know where we went wrong so we can fix it?</p>' +
11
  '<ul class="reasons" style="padding: 0">' +
12
  '<p><strong>Why you are deactivating this plugin?</strong></p>' +
 
13
  ' <li><label class="reason expand"><input type="radio" name="reason" value="missing-feature" /> The plugin is great, but I need specific feature that you don\'t support</label><textarea placeholder="Which feature do you need?"></textarea></li>' +
14
  '<li><label class="reason expand"><input type="radio" name="reason" value="not-working"> The plugin is not working</label><textarea placeholder="Please clarify which part of the plugin isn\'t working so we can try and fix it..."></textarea></li>' +
15
  '<li><label class="reason expand"><input type="radio" name="reason" value="other-plugin"> I found a better plugin</label><textarea placeholder="What\'s the plugin name?"></textarea></li>' +
10
  '<p>We\'re sorry our Google Fonts plugin didn\'t work for you. Would you mind letting us know where we went wrong so we can fix it?</p>' +
11
  '<ul class="reasons" style="padding: 0">' +
12
  '<p><strong>Why you are deactivating this plugin?</strong></p>' +
13
+ ' <li><label class="reason expand"><input type="radio" name="reason" value="missing-font" /> The font I need is missing</label><textarea placeholder="Which font do you need?"></textarea></li>' +
14
  ' <li><label class="reason expand"><input type="radio" name="reason" value="missing-feature" /> The plugin is great, but I need specific feature that you don\'t support</label><textarea placeholder="Which feature do you need?"></textarea></li>' +
15
  '<li><label class="reason expand"><input type="radio" name="reason" value="not-working"> The plugin is not working</label><textarea placeholder="Please clarify which part of the plugin isn\'t working so we can try and fix it..."></textarea></li>' +
16
  '<li><label class="reason expand"><input type="radio" name="reason" value="other-plugin"> I found a better plugin</label><textarea placeholder="What\'s the plugin name?"></textarea></li>' +
changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  = 1.7.1 =
2
 
3
  * Fix changelog.txt link and include file in package.
1
+ = 1.7.2 =
2
+
3
+ * Add system fonts to the available choices.
4
+ * Remove font_choices_for_select() to reduce the amount of code output in the customizer.
5
+ * Fix issue where line-height is always 1.
6
+
7
  = 1.7.1 =
8
 
9
  * Fix changelog.txt link and include file in package.
class-olympus-google-fonts.php CHANGED
@@ -110,7 +110,7 @@ class Olympus_Google_Fonts {
110
  wp_enqueue_style( 'ogf-customize-controls', esc_url( OGF_DIR_URL . 'assets/css/customize-controls.css' ), array(), OGF_VERSION );
111
 
112
  wp_localize_script( 'ogf-customize-controls', 'ogf_font_array', ogf_fonts_array() );
113
- wp_localize_script( 'ogf-customize-controls', 'ogf_font_choices', ogf_font_choices_for_select() );
114
 
115
  }
116
 
@@ -124,6 +124,7 @@ class Olympus_Google_Fonts {
124
  $elements = array_merge( ogf_get_elements(), ogf_get_custom_elements() );
125
 
126
  wp_localize_script( 'ogf-customize-preview', 'ogf_elements', $elements );
 
127
 
128
  }
129
 
110
  wp_enqueue_style( 'ogf-customize-controls', esc_url( OGF_DIR_URL . 'assets/css/customize-controls.css' ), array(), OGF_VERSION );
111
 
112
  wp_localize_script( 'ogf-customize-controls', 'ogf_font_array', ogf_fonts_array() );
113
+ wp_localize_script( 'ogf-customize-controls', 'ogf_system_fonts', ogf_system_fonts() );
114
 
115
  }
116
 
124
  $elements = array_merge( ogf_get_elements(), ogf_get_custom_elements() );
125
 
126
  wp_localize_script( 'ogf-customize-preview', 'ogf_elements', $elements );
127
+ wp_localize_script( 'ogf-customize-preview', 'ogf_system_fonts', ogf_system_fonts() );
128
 
129
  }
130
 
includes/customizer/controls/class-ogf-customize-typography-control.php CHANGED
@@ -96,7 +96,7 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
96
 
97
  <ul>
98
 
99
- <# if ( data.family && ogf_font_choices ) { #>
100
 
101
  <li class="typography-font-family">
102
 
@@ -106,14 +106,22 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
106
 
107
  <select class="ogf-select" {{{ data.family.link }}}>
108
 
109
- <# _.each( ogf_font_choices, function( label, font_id ) { #>
110
- <option value="{{ font_id }}" <# if ( font_id === data.family.value ) { #> selected="selected" <# } #>>{{ label }}</option>
 
 
 
 
 
 
 
 
111
  <# } ) #>
112
 
113
  </select>
114
 
115
  <button type="button" class="advanced-button">
116
- <span class="screen-reader-text">Advanced</span>
117
  </button>
118
  </li>
119
  <# } #>
@@ -240,6 +248,14 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
240
  );
241
  }
242
 
 
 
 
 
 
 
 
 
243
  $fonts = ogf_fonts_array();
244
 
245
  $variants = $fonts[ $font ]['variants'];
@@ -258,4 +274,5 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
258
  'oblique' => esc_html__( 'Oblique', 'olympus-google-fonts' ),
259
  );
260
  }
 
261
  }
96
 
97
  <ul>
98
 
99
+ <# if ( data.family && ogf_font_array ) { #>
100
 
101
  <li class="typography-font-family">
102
 
106
 
107
  <select class="ogf-select" {{{ data.family.link }}}>
108
 
109
+ <option value="default"><?php esc_html_e( 'Default Font', 'olympus-google-fonts' ); ?></option>
110
+ <option disabled><?php esc_html_e( '- System Fonts -', 'olympus-google-fonts' ); ?></option>
111
+ <# _.each( ogf_system_fonts, function( font_data, font_id ) { #>
112
+ <option value="sf-{{ font_id }}" <# if ( font_id === data.family.value ) { #> selected="selected" <# } #>>{{ font_data.label }}</option>
113
+ <# } ) #>
114
+
115
+ <option disabled><?php esc_html_e( '- Google Fonts -', 'olympus-google-fonts' ); ?></option>
116
+
117
+ <# _.each( ogf_font_array, function( font_data, font_id ) { #>
118
+ <option value="{{ font_id }}" <# if ( font_id === data.family.value ) { #> selected="selected" <# } #>>{{ font_data.family }}</option>
119
  <# } ) #>
120
 
121
  </select>
122
 
123
  <button type="button" class="advanced-button">
124
+ <span class="screen-reader-text"><?php esc_html_e( 'Advanced', 'olympus-google-fonts' ); ?></span>
125
  </button>
126
  </li>
127
  <# } #>
248
  );
249
  }
250
 
251
+ if ( ogf_is_system_font( $font ) ) {
252
+ return array(
253
+ '0' => esc_html__( '- Default -', 'olympus-google-fonts' ),
254
+ '400' => esc_html__( 'Normal', 'olympus-google-fonts' ),
255
+ '700' => esc_html__( 'Bold', 'olympus-google-fonts' ),
256
+ );
257
+ }
258
+
259
  $fonts = ogf_fonts_array();
260
 
261
  $variants = $fonts[ $font ]['variants'];
274
  'oblique' => esc_html__( 'Oblique', 'olympus-google-fonts' ),
275
  );
276
  }
277
+
278
  }
includes/customizer/output-css.php CHANGED
@@ -76,7 +76,7 @@ function ogf_generate_css( $selector, $option_name ) {
76
  if ( $font_size ) {
77
  $return .= sprintf(
78
  'font-size: %s;' . PHP_EOL,
79
- absint( $font_size ) . 'px' . ogf_is_forced()
80
  );
81
  }
82
 
@@ -84,7 +84,7 @@ function ogf_generate_css( $selector, $option_name ) {
84
  if ( $line_height && '0' !== $line_height ) {
85
  $return .= sprintf(
86
  'line-height: %s;' . PHP_EOL,
87
- absint( $line_height ) . ogf_is_forced()
88
  );
89
  }
90
 
@@ -138,6 +138,18 @@ function ogf_build_font_stack( $font_id ) {
138
 
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  }
142
 
143
  /**
76
  if ( $font_size ) {
77
  $return .= sprintf(
78
  'font-size: %s;' . PHP_EOL,
79
+ floatval( $font_size ) . 'px' . ogf_is_forced()
80
  );
81
  }
82
 
84
  if ( $line_height && '0' !== $line_height ) {
85
  $return .= sprintf(
86
  'line-height: %s;' . PHP_EOL,
87
+ floatval( $line_height ) . ogf_is_forced()
88
  );
89
  }
90
 
138
 
139
  }
140
 
141
+ $system_fonts = ogf_system_fonts();
142
+
143
+ $font_id = str_replace( 'sf-', '', $font_id );
144
+
145
+ if ( array_key_exists( $font_id, $system_fonts ) ) {
146
+
147
+ $stack = '"' . $system_fonts[ $font_id ]['stack'] . '"';
148
+
149
+ return $stack;
150
+
151
+ }
152
+
153
  }
154
 
155
  /**
includes/customizer/settings.php CHANGED
@@ -147,6 +147,10 @@ function ogf_customize_register( $wp_customize ) {
147
  // Build the selective font loading controls.
148
  foreach ( $choices as $font_id ) {
149
 
 
 
 
 
150
  $weights = $fonts->get_font_weights( $font_id );
151
  $name = $fonts->get_font_name( $font_id );
152
  unset( $weights[0] );
147
  // Build the selective font loading controls.
148
  foreach ( $choices as $font_id ) {
149
 
150
+ if ( ogf_is_system_font( $font_id ) ) {
151
+ return;
152
+ }
153
+
154
  $weights = $fonts->get_font_weights( $font_id );
155
  $name = $fonts->get_font_name( $font_id );
156
  unset( $weights[0] );
includes/functions.php CHANGED
@@ -34,37 +34,37 @@ function ogf_get_custom_elements() {
34
  function ogf_get_elements() {
35
 
36
  $elements = array(
37
- 'ogf_body' => array(
38
  'label' => esc_html__( 'Base Typography', 'olympus-google-fonts' ),
39
  'description' => esc_html__( 'Select and configure the font for your content.', 'olympus-google-fonts' ),
40
  'section' => 'ogf_basic',
41
  'selectors' => 'body',
42
  ),
43
- 'ogf_headings' => array(
44
  'label' => esc_html__( 'Headings Typography', 'olympus-google-fonts' ),
45
  'description' => esc_html__( 'Select and configure the font for your headings.', 'olympus-google-fonts' ),
46
  'section' => 'ogf_basic',
47
  'selectors' => '#site-title, .site-title, #site-title a, .site-title a, .entry-title, .entry-title a, h1, h2, h3, h4, h5, h6',
48
  ),
49
- 'ogf_inputs' => array(
50
  'label' => esc_html__( 'Buttons and Inputs Typography', 'olympus-google-fonts' ),
51
  'description' => esc_html__( 'Select and configure the font for your input fields and buttons.', 'olympus-google-fonts' ),
52
  'section' => 'ogf_basic',
53
  'selectors' => 'button, input, select, textarea',
54
  ),
55
- 'ogf_site_title' => array(
56
  'label' => esc_html__( 'Site Title Typography', 'olympus-google-fonts' ),
57
  'description' => esc_html__( 'Select and configure the font for your site title.', 'olympus-google-fonts' ),
58
  'section' => 'ogf_advanced__branding',
59
  'selectors' => '#site-title, .site-title, #site-title a, .site-title a, #logo, #logo a, .logo, .logo a',
60
  ),
61
- 'ogf_site_description' => array(
62
  'label' => esc_html__( 'Site Description Typography', 'olympus-google-fonts' ),
63
  'description' => esc_html__( 'Select and configure the font for your site description.', 'olympus-google-fonts' ),
64
  'section' => 'ogf_advanced__branding',
65
  'selectors' => '#site-description, .site-description',
66
  ),
67
- 'ogf_site_navigation' => array(
68
  'label' => esc_html__( 'Navigation Typography', 'olympus-google-fonts' ),
69
  'description' => esc_html__( 'Select and configure the font for your site navigation.', 'olympus-google-fonts' ),
70
  'section' => 'ogf_advanced__navigation',
@@ -76,55 +76,55 @@ function ogf_get_elements() {
76
  'section' => 'ogf_advanced__content',
77
  'selectors' => '.entry-content, .post-content, .page-content, .post-excerpt, .entry-summary, .entry-excerpt',
78
  ),
79
- 'ogf_post_page_h1' => array(
80
  'label' => esc_html__( 'Title and H1 Typography', 'olympus-google-fonts' ),
81
  'description' => esc_html__( 'Select and configure the font for your title and H1 headings.', 'olympus-google-fonts' ),
82
  'section' => 'ogf_advanced__content',
83
  'selectors' => '.entry-title, .entry-title a, .post-title, .post-title a, .page-title, .entry-content h1',
84
  ),
85
- 'ogf_post_page_h2' => array(
86
  'label' => esc_html__( 'H2 Typography', 'olympus-google-fonts' ),
87
  'description' => esc_html__( 'Select and configure the font for your H2 headings.', 'olympus-google-fonts' ),
88
  'section' => 'ogf_advanced__content',
89
  'selectors' => '.entry-content h2, .post-content h2, .page-content h2',
90
  ),
91
- 'ogf_post_page_h3' => array(
92
  'label' => esc_html__( 'H3 Typography', 'olympus-google-fonts' ),
93
  'description' => esc_html__( 'Select and configure the font for your H3 headings.', 'olympus-google-fonts' ),
94
  'section' => 'ogf_advanced__content',
95
  'selectors' => '.entry-content h3, .post-content h3, .page-content h3',
96
  ),
97
- 'ogf_post_page_h4' => array(
98
  'label' => esc_html__( 'H4 Typography', 'olympus-google-fonts' ),
99
  'description' => esc_html__( 'Select and configure the font for your H4 headings.', 'olympus-google-fonts' ),
100
  'section' => 'ogf_advanced__content',
101
  'selectors' => '.entry-content h4, .post-content h4, .page-content h4',
102
  ),
103
- 'ogf_post_page_h5' => array(
104
  'label' => esc_html__( 'H5 Typography', 'olympus-google-fonts' ),
105
  'description' => esc_html__( 'Select and configure the font for your H5 headings.', 'olympus-google-fonts' ),
106
  'section' => 'ogf_advanced__content',
107
  'selectors' => '.entry-content h5, .post-content h5, .page-content h5',
108
  ),
109
- 'ogf_post_page_h6' => array(
110
  'label' => esc_html__( 'H6 Typography', 'olympus-google-fonts' ),
111
  'description' => esc_html__( 'Select and configure the font for your H6 headings.', 'olympus-google-fonts' ),
112
  'section' => 'ogf_advanced__content',
113
  'selectors' => '.entry-content h6, .post-content h6, .page-content h6',
114
  ),
115
- 'ogf_sidebar_headings' => array(
116
  'label' => esc_html__( 'Headings Typography', 'olympus-google-fonts' ),
117
  'description' => esc_html__( 'Select and configure the font for your sidebar headings.', 'olympus-google-fonts' ),
118
  'section' => 'ogf_advanced__sidebar',
119
  'selectors' => '.widget-title, .widget-area h1, .widget-area h2, .widget-area h3, .widget-area h4, .widgets-area h5, .widget-area h6',
120
  ),
121
- 'ogf_sidebar_content' => array(
122
  'label' => esc_html__( 'Content Typography', 'olympus-google-fonts' ),
123
  'description' => esc_html__( 'Select and configure the font for your sidebar content.', 'olympus-google-fonts' ),
124
  'section' => 'ogf_advanced__sidebar',
125
  'selectors' => '.widget-area, .widget, .sidebar, #sidebar',
126
  ),
127
- 'ogf_footer_headings' => array(
128
  'label' => esc_html__( 'Headings Typography', 'olympus-google-fonts' ),
129
  'description' => esc_html__( 'Select and configure the font for your footer headings.', 'olympus-google-fonts' ),
130
  'section' => 'ogf_advanced__footer',
@@ -132,7 +132,7 @@ function ogf_get_elements() {
132
  .footer h1, .footer h2, .footer h3, .footer h4, .footer h5, .footer h6
133
  #footer h1, #footer h2, #footer h3, #footer h4, #footer h5, #footer h6',
134
  ),
135
- 'ogf_footer_content' => array(
136
  'label' => esc_html__( 'Content Typography', 'olympus-google-fonts' ),
137
  'description' => esc_html__( 'Select and configure the font for your footer content.', 'olympus-google-fonts' ),
138
  'section' => 'ogf_advanced__footer',
@@ -207,24 +207,89 @@ function ogf_fonts_array() {
207
  }
208
 
209
  return $fonts;
210
-
211
  }
212
 
213
  /**
214
- * Build the array for the select choices setting.
215
  */
216
- function ogf_font_choices_for_select() {
217
-
218
- $fonts_array = ogf_fonts_array();
219
-
220
- $fonts = array(
221
- 'default' => esc_html__( '- Default -', 'olympus-google-fonts' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  );
223
 
224
- foreach ( $fonts_array as $key => $value ) {
225
- $fonts[ $key ] = $value['family'];
226
- }
227
 
228
- return $fonts;
229
 
230
  }
 
 
 
 
 
 
 
 
 
 
 
 
34
  function ogf_get_elements() {
35
 
36
  $elements = array(
37
+ 'ogf_body' => array(
38
  'label' => esc_html__( 'Base Typography', 'olympus-google-fonts' ),
39
  'description' => esc_html__( 'Select and configure the font for your content.', 'olympus-google-fonts' ),
40
  'section' => 'ogf_basic',
41
  'selectors' => 'body',
42
  ),
43
+ 'ogf_headings' => array(
44
  'label' => esc_html__( 'Headings Typography', 'olympus-google-fonts' ),
45
  'description' => esc_html__( 'Select and configure the font for your headings.', 'olympus-google-fonts' ),
46
  'section' => 'ogf_basic',
47
  'selectors' => '#site-title, .site-title, #site-title a, .site-title a, .entry-title, .entry-title a, h1, h2, h3, h4, h5, h6',
48
  ),
49
+ 'ogf_inputs' => array(
50
  'label' => esc_html__( 'Buttons and Inputs Typography', 'olympus-google-fonts' ),
51
  'description' => esc_html__( 'Select and configure the font for your input fields and buttons.', 'olympus-google-fonts' ),
52
  'section' => 'ogf_basic',
53
  'selectors' => 'button, input, select, textarea',
54
  ),
55
+ 'ogf_site_title' => array(
56
  'label' => esc_html__( 'Site Title Typography', 'olympus-google-fonts' ),
57
  'description' => esc_html__( 'Select and configure the font for your site title.', 'olympus-google-fonts' ),
58
  'section' => 'ogf_advanced__branding',
59
  'selectors' => '#site-title, .site-title, #site-title a, .site-title a, #logo, #logo a, .logo, .logo a',
60
  ),
61
+ 'ogf_site_description' => array(
62
  'label' => esc_html__( 'Site Description Typography', 'olympus-google-fonts' ),
63
  'description' => esc_html__( 'Select and configure the font for your site description.', 'olympus-google-fonts' ),
64
  'section' => 'ogf_advanced__branding',
65
  'selectors' => '#site-description, .site-description',
66
  ),
67
+ 'ogf_site_navigation' => array(
68
  'label' => esc_html__( 'Navigation Typography', 'olympus-google-fonts' ),
69
  'description' => esc_html__( 'Select and configure the font for your site navigation.', 'olympus-google-fonts' ),
70
  'section' => 'ogf_advanced__navigation',
76
  'section' => 'ogf_advanced__content',
77
  'selectors' => '.entry-content, .post-content, .page-content, .post-excerpt, .entry-summary, .entry-excerpt',
78
  ),
79
+ 'ogf_post_page_h1' => array(
80
  'label' => esc_html__( 'Title and H1 Typography', 'olympus-google-fonts' ),
81
  'description' => esc_html__( 'Select and configure the font for your title and H1 headings.', 'olympus-google-fonts' ),
82
  'section' => 'ogf_advanced__content',
83
  'selectors' => '.entry-title, .entry-title a, .post-title, .post-title a, .page-title, .entry-content h1',
84
  ),
85
+ 'ogf_post_page_h2' => array(
86
  'label' => esc_html__( 'H2 Typography', 'olympus-google-fonts' ),
87
  'description' => esc_html__( 'Select and configure the font for your H2 headings.', 'olympus-google-fonts' ),
88
  'section' => 'ogf_advanced__content',
89
  'selectors' => '.entry-content h2, .post-content h2, .page-content h2',
90
  ),
91
+ 'ogf_post_page_h3' => array(
92
  'label' => esc_html__( 'H3 Typography', 'olympus-google-fonts' ),
93
  'description' => esc_html__( 'Select and configure the font for your H3 headings.', 'olympus-google-fonts' ),
94
  'section' => 'ogf_advanced__content',
95
  'selectors' => '.entry-content h3, .post-content h3, .page-content h3',
96
  ),
97
+ 'ogf_post_page_h4' => array(
98
  'label' => esc_html__( 'H4 Typography', 'olympus-google-fonts' ),
99
  'description' => esc_html__( 'Select and configure the font for your H4 headings.', 'olympus-google-fonts' ),
100
  'section' => 'ogf_advanced__content',
101
  'selectors' => '.entry-content h4, .post-content h4, .page-content h4',
102
  ),
103
+ 'ogf_post_page_h5' => array(
104
  'label' => esc_html__( 'H5 Typography', 'olympus-google-fonts' ),
105
  'description' => esc_html__( 'Select and configure the font for your H5 headings.', 'olympus-google-fonts' ),
106
  'section' => 'ogf_advanced__content',
107
  'selectors' => '.entry-content h5, .post-content h5, .page-content h5',
108
  ),
109
+ 'ogf_post_page_h6' => array(
110
  'label' => esc_html__( 'H6 Typography', 'olympus-google-fonts' ),
111
  'description' => esc_html__( 'Select and configure the font for your H6 headings.', 'olympus-google-fonts' ),
112
  'section' => 'ogf_advanced__content',
113
  'selectors' => '.entry-content h6, .post-content h6, .page-content h6',
114
  ),
115
+ 'ogf_sidebar_headings' => array(
116
  'label' => esc_html__( 'Headings Typography', 'olympus-google-fonts' ),
117
  'description' => esc_html__( 'Select and configure the font for your sidebar headings.', 'olympus-google-fonts' ),
118
  'section' => 'ogf_advanced__sidebar',
119
  'selectors' => '.widget-title, .widget-area h1, .widget-area h2, .widget-area h3, .widget-area h4, .widgets-area h5, .widget-area h6',
120
  ),
121
+ 'ogf_sidebar_content' => array(
122
  'label' => esc_html__( 'Content Typography', 'olympus-google-fonts' ),
123
  'description' => esc_html__( 'Select and configure the font for your sidebar content.', 'olympus-google-fonts' ),
124
  'section' => 'ogf_advanced__sidebar',
125
  'selectors' => '.widget-area, .widget, .sidebar, #sidebar',
126
  ),
127
+ 'ogf_footer_headings' => array(
128
  'label' => esc_html__( 'Headings Typography', 'olympus-google-fonts' ),
129
  'description' => esc_html__( 'Select and configure the font for your footer headings.', 'olympus-google-fonts' ),
130
  'section' => 'ogf_advanced__footer',
132
  .footer h1, .footer h2, .footer h3, .footer h4, .footer h5, .footer h6
133
  #footer h1, #footer h2, #footer h3, #footer h4, #footer h5, #footer h6',
134
  ),
135
+ 'ogf_footer_content' => array(
136
  'label' => esc_html__( 'Content Typography', 'olympus-google-fonts' ),
137
  'description' => esc_html__( 'Select and configure the font for your footer content.', 'olympus-google-fonts' ),
138
  'section' => 'ogf_advanced__footer',
207
  }
208
 
209
  return $fonts;
 
210
  }
211
 
212
  /**
213
+ * Return a array of system fonts.
214
  */
215
+ function ogf_system_fonts() {
216
+ $system_fonts = array(
217
+ 'arial' => array(
218
+ 'id' => 'arial',
219
+ 'label' => esc_html__( 'Arial', 'olympus-google-fonts' ),
220
+ 'stack' => 'Arial, Helvetica Neue, Helvetica, sans-serif',
221
+ ),
222
+ 'calibri' => array(
223
+ 'id' => 'calibri',
224
+ 'label' => esc_html__( 'Calibri', 'olympus-google-fonts' ),
225
+ 'stack' => 'Calibri, Candara, Segoe, Segoe UI, Optima, Arial, sans-serif;',
226
+ ),
227
+ 'consolas' => array(
228
+ 'id' => 'consolas',
229
+ 'label' => esc_html__( 'Consolas', 'olympus-google-fonts' ),
230
+ 'stack' => 'Consolas, monaco, monospace',
231
+ ),
232
+ 'courier-new' => array(
233
+ 'id' => 'courier-new',
234
+ 'label' => esc_html__( 'Courier New', 'olympus-google-fonts' ),
235
+ 'stack' => 'Courier New, Courier, Lucida Sans Typewriter, Lucida Typewriter, monospace',
236
+ ),
237
+ 'helvetica' => array(
238
+ 'id' => 'helvetica',
239
+ 'label' => esc_html__( 'Helvetica', 'olympus-google-fonts' ),
240
+ 'stack' => 'Helvetica Neue, Helvetica, Arial, sans-serif',
241
+ ),
242
+ 'georgia' => array(
243
+ 'id' => 'georgia',
244
+ 'label' => esc_html__( 'Georgia', 'olympus-google-fonts' ),
245
+ 'stack' => 'Georgia, Times, Times New Roman, serif',
246
+ ),
247
+ 'lucida-grande' => array(
248
+ 'id' => 'lucida-grande',
249
+ 'label' => esc_html__( 'Lucida Grande', 'olympus-google-fonts' ),
250
+ 'stack' => 'Lucida Grande, Lucida Sans Unicode, Lucida Sans, Geneva, Verdana, sans-serif',
251
+ ),
252
+ 'tahoma' => array(
253
+ 'id' => 'tahoma',
254
+ 'label' => esc_html__( 'Tahoma', 'olympus-google-fonts' ),
255
+ 'stack' => 'Tahoma, Verdana, Segoe, sans-serif',
256
+ ),
257
+ 'times-new-roman' => array(
258
+ 'id' => 'times-new-roman',
259
+ 'label' => esc_html__( 'Times New Roman', 'olympus-google-fonts' ),
260
+ 'stack' => 'TimesNewRoman, Times New Roman, Times, Baskerville, Georgia, serif',
261
+ ),
262
+ 'trebuchet' => array(
263
+ 'id' => 'trebuchet',
264
+ 'label' => esc_html__( 'Trebuchet MS', 'olympus-google-fonts' ),
265
+ 'stack' => 'Trebuchet MS, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Tahoma, sans-serif',
266
+ ),
267
+ 'palatino' => array(
268
+ 'id' => 'palatino',
269
+ 'label' => esc_html__( 'Palatino', 'olympus-google-fonts' ),
270
+ 'stack' => 'Palatino, Palatino Linotype, Palatino LT STD, Book Antiqua, Georgia, serif',
271
+ ),
272
+ 'verdana' => array(
273
+ 'id' => 'verdana',
274
+ 'label' => esc_html__( 'Verdana', 'olympus-google-fonts' ),
275
+ 'stack' => 'Verdana, Geneva, sans-serif;',
276
+ ),
277
  );
278
 
279
+ $filtered_system_fonts = apply_filters( 'ogf_system_fonts', $system_fonts );
 
 
280
 
281
+ return $filtered_system_fonts;
282
 
283
  }
284
+
285
+ /**
286
+ * Check if a font is a system font (not Google Font).
287
+ *
288
+ * @param string $font_id The ID of the font to check.
289
+ */
290
+ function ogf_is_system_font( $font_id ) {
291
+ if ( strpos( $font_id, 'sf-' ) === 0 ) {
292
+ return true;
293
+ }
294
+ return false;
295
+ }
languages/olympus-google-fonts.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Google Fonts for WordPress plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Google Fonts for WordPress 1.6.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/olympus-google-fonts\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2019-04-25T09:07:31+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.1.0\n"
15
  "X-Domain: olympus-google-fonts\n"
@@ -35,11 +35,11 @@ msgstr ""
35
  msgid "https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading"
36
  msgstr ""
37
 
38
- #: class-olympus-google-fonts.php:138
39
  msgid "Settings"
40
  msgstr ""
41
 
42
- #: class-olympus-google-fonts.php:143
43
  msgid "Upgrade to Pro"
44
  msgstr ""
45
 
@@ -168,58 +168,108 @@ msgid "Select and configure the font for your footer content."
168
  msgstr ""
169
 
170
  #: includes/functions.php:182
171
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:231
172
  msgid "Thin"
173
  msgstr ""
174
 
175
  #: includes/functions.php:183
176
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:232
177
  msgid "Extra Light"
178
  msgstr ""
179
 
180
  #: includes/functions.php:184
181
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:233
182
  msgid "Light"
183
  msgstr ""
184
 
185
  #: includes/functions.php:185
186
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:234
187
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:256
 
188
  msgid "Normal"
189
  msgstr ""
190
 
191
  #: includes/functions.php:186
192
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:235
193
  msgid "Medium"
194
  msgstr ""
195
 
196
  #: includes/functions.php:187
197
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:236
198
  msgid "Semi Bold"
199
  msgstr ""
200
 
201
  #: includes/functions.php:188
202
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:237
 
203
  msgid "Bold"
204
  msgstr ""
205
 
206
  #: includes/functions.php:189
207
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:238
208
  msgid "Extra Bold"
209
  msgstr ""
210
 
211
  #: includes/functions.php:190
212
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:239
213
  msgid "Ultra Bold"
214
  msgstr ""
215
 
216
  #: includes/functions.php:197
217
- #: includes/functions.php:221
218
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:230
219
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:255
220
  msgid "- Default -"
221
  msgstr ""
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  #. translators: %s Link to Google Fonts customizer panel.
224
  #: includes/class-ogf-welcome.php:104
225
  msgid "Thank you for installing <strong>Google Fonts for WordPress</strong>! Configure your fonts here: <a href=\"%s\">WordPress Customizer</a>"
@@ -421,11 +471,27 @@ msgstr ""
421
  msgid "Color"
422
  msgstr ""
423
 
424
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  msgid "Italic"
426
  msgstr ""
427
 
428
- #: includes/customizer/controls/class-ogf-customize-typography-control.php:258
429
  msgid "Oblique"
430
  msgstr ""
431
 
2
  # This file is distributed under the same license as the Google Fonts for WordPress plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Google Fonts for WordPress 1.7.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/olympus-google-fonts\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2019-05-08T16:48:48+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.1.0\n"
15
  "X-Domain: olympus-google-fonts\n"
35
  msgid "https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading"
36
  msgstr ""
37
 
38
+ #: class-olympus-google-fonts.php:141
39
  msgid "Settings"
40
  msgstr ""
41
 
42
+ #: class-olympus-google-fonts.php:146
43
  msgid "Upgrade to Pro"
44
  msgstr ""
45
 
168
  msgstr ""
169
 
170
  #: includes/functions.php:182
171
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:239
172
  msgid "Thin"
173
  msgstr ""
174
 
175
  #: includes/functions.php:183
176
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:240
177
  msgid "Extra Light"
178
  msgstr ""
179
 
180
  #: includes/functions.php:184
181
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:241
182
  msgid "Light"
183
  msgstr ""
184
 
185
  #: includes/functions.php:185
186
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:242
187
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:254
188
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:272
189
  msgid "Normal"
190
  msgstr ""
191
 
192
  #: includes/functions.php:186
193
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:243
194
  msgid "Medium"
195
  msgstr ""
196
 
197
  #: includes/functions.php:187
198
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:244
199
  msgid "Semi Bold"
200
  msgstr ""
201
 
202
  #: includes/functions.php:188
203
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:245
204
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:255
205
  msgid "Bold"
206
  msgstr ""
207
 
208
  #: includes/functions.php:189
209
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:246
210
  msgid "Extra Bold"
211
  msgstr ""
212
 
213
  #: includes/functions.php:190
214
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:247
215
  msgid "Ultra Bold"
216
  msgstr ""
217
 
218
  #: includes/functions.php:197
219
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:238
220
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:253
221
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:271
222
  msgid "- Default -"
223
  msgstr ""
224
 
225
+ #: includes/functions.php:219
226
+ msgid "Arial"
227
+ msgstr ""
228
+
229
+ #: includes/functions.php:224
230
+ msgid "Calibri"
231
+ msgstr ""
232
+
233
+ #: includes/functions.php:229
234
+ msgid "Consolas"
235
+ msgstr ""
236
+
237
+ #: includes/functions.php:234
238
+ msgid "Courier New"
239
+ msgstr ""
240
+
241
+ #: includes/functions.php:239
242
+ msgid "Helvetica"
243
+ msgstr ""
244
+
245
+ #: includes/functions.php:244
246
+ msgid "Georgia"
247
+ msgstr ""
248
+
249
+ #: includes/functions.php:249
250
+ msgid "Lucida Grande"
251
+ msgstr ""
252
+
253
+ #: includes/functions.php:254
254
+ msgid "Tahoma"
255
+ msgstr ""
256
+
257
+ #: includes/functions.php:259
258
+ msgid "Times New Roman"
259
+ msgstr ""
260
+
261
+ #: includes/functions.php:264
262
+ msgid "Trebuchet MS"
263
+ msgstr ""
264
+
265
+ #: includes/functions.php:269
266
+ msgid "Palatino"
267
+ msgstr ""
268
+
269
+ #: includes/functions.php:274
270
+ msgid "Verdana"
271
+ msgstr ""
272
+
273
  #. translators: %s Link to Google Fonts customizer panel.
274
  #: includes/class-ogf-welcome.php:104
275
  msgid "Thank you for installing <strong>Google Fonts for WordPress</strong>! Configure your fonts here: <a href=\"%s\">WordPress Customizer</a>"
471
  msgid "Color"
472
  msgstr ""
473
 
474
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:109
475
+ msgid "Default Font"
476
+ msgstr ""
477
+
478
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:110
479
+ msgid "- System Fonts -"
480
+ msgstr ""
481
+
482
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:115
483
+ msgid "- Google Fonts -"
484
+ msgstr ""
485
+
486
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:124
487
+ msgid "Advanced"
488
+ msgstr ""
489
+
490
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:273
491
  msgid "Italic"
492
  msgstr ""
493
 
494
+ #: includes/customizer/controls/class-ogf-customize-typography-control.php:274
495
  msgid "Oblique"
496
  msgstr ""
497
 
olympus-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: Google Fonts for WordPress
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts plugin. No coding required. 870+ font choices.
8
- * Version: 1.7.1
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', '1.7.1' );
22
  define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
24
 
5
  * Plugin Name: Google Fonts for WordPress
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts plugin. No coding required. 870+ font choices.
8
+ * Version: 1.7.2
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', '1.7.2' );
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.2
7
  License: GPLv2 or later
8
- Stable tag: 1.7.1
9
 
10
  The easiest to use Google Fonts Plugin. No coding required. 870+ font choices.
11
 
5
  Requires at least: 4.0
6
  Tested up to: 5.2
7
  License: GPLv2 or later
8
+ Stable tag: 1.7.2
9
 
10
  The easiest to use Google Fonts Plugin. No coding required. 870+ font choices.
11