Version Description
- Fix problem with italics not being loaded.
Download this release
Release Info
Developer | DannyCooper |
Plugin | Google Fonts for WordPress |
Version | 1.5.0 |
Comparing to | |
See all releases |
Code changes from version 1.4.8 to 1.5.0
- blocks/init.php +1 -1
- class-olympus-google-fonts.php +1 -1
- includes/class-ogf-deactivation.php +3 -3
- includes/class-ogf-feedback.php +2 -26
- includes/class-ogf-fonts.php +20 -2
- includes/class-ogf-welcome.php +5 -1
- includes/customizer/controls/class-ogf-customize-multiple-checkbox-control.php +1 -1
- includes/customizer/controls/class-ogf-customize-panel.php +1 -1
- includes/customizer/controls/class-ogf-customize-repeater-control.php +1 -1
- includes/customizer/controls/class-ogf-customize-typography-control.php +1 -1
- includes/customizer/controls/class-ogf-customize-upsell-control.php +1 -1
- includes/customizer/output-css.php +5 -1
- includes/customizer/panels.php +1 -1
- includes/customizer/settings.php +2 -2
- includes/functions.php +8 -1
- olympus-google-fonts.php +3 -3
- readme.txt +19 -108
blocks/init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Blocks Package
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Blocks Package
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
class-olympus-google-fonts.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Main Olympus_Google_Fonts Class
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Main Olympus_Google_Fonts Class
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/class-ogf-deactivation.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Deactivation Feedback Class.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
@@ -45,7 +45,7 @@ class OGF_Deactivation {
|
|
45 |
* @param $string $email WordPress email address.
|
46 |
*/
|
47 |
public function ogf_mail_from_email( $email ) {
|
48 |
-
return '
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -81,7 +81,7 @@ class OGF_Deactivation {
|
|
81 |
$user = 'anon@anonymous.com';
|
82 |
}
|
83 |
|
84 |
-
$to = '
|
85 |
$subject = 'Deactivation Survey';
|
86 |
$headers = array( 'Content-Type: text/html; charset=UTF-8' );
|
87 |
|
3 |
* Deactivation Feedback Class.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
45 |
* @param $string $email WordPress email address.
|
46 |
*/
|
47 |
public function ogf_mail_from_email( $email ) {
|
48 |
+
return 'hello@fontsplugin.com';
|
49 |
}
|
50 |
|
51 |
/**
|
81 |
$user = 'anon@anonymous.com';
|
82 |
}
|
83 |
|
84 |
+
$to = 'hello@fontsplugin.com';
|
85 |
$subject = 'Deactivation Survey';
|
86 |
$headers = array( 'Content-Type: text/html; charset=UTF-8' );
|
87 |
|
includes/class-ogf-feedback.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* https://winwar.co.uk/2014/10/ask-wordpress-plugin-reviews-week/
|
8 |
*
|
9 |
* @package olympus-google-fonts
|
10 |
-
* @copyright Copyright (c)
|
11 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
12 |
*/
|
13 |
|
@@ -102,30 +102,6 @@ if ( ! class_exists( 'OGF_Feedback' ) ) :
|
|
102 |
} elseif ( $days > 0 ) {
|
103 |
return __( 'a day', 'olympus-google-fonts' );
|
104 |
}
|
105 |
-
// Get the hours.
|
106 |
-
$hours = ( intval( $seconds ) / HOUR_IN_SECONDS ) % 24;
|
107 |
-
if ( $hours > 1 ) {
|
108 |
-
/* translators: Number of hours */
|
109 |
-
return sprintf( __( '%s hours', 'olympus-google-fonts' ), $hours );
|
110 |
-
} elseif ( $hours > 0 ) {
|
111 |
-
return __( 'an hour', 'olympus-google-fonts' );
|
112 |
-
}
|
113 |
-
// Get the minutes.
|
114 |
-
$minutes = ( intval( $seconds ) / MINUTE_IN_SECONDS ) % 60;
|
115 |
-
if ( $minutes > 1 ) {
|
116 |
-
/* translators: Number of minutes */
|
117 |
-
return sprintf( __( '%s minutes', 'olympus-google-fonts' ), $minutes );
|
118 |
-
} elseif ( $minutes > 0 ) {
|
119 |
-
return __( 'a minute', 'olympus-google-fonts' );
|
120 |
-
}
|
121 |
-
// Get the seconds.
|
122 |
-
$seconds = intval( $seconds ) % 60;
|
123 |
-
if ( $seconds > 1 ) {
|
124 |
-
/* translators: Number of seconds */
|
125 |
-
return sprintf( __( '%s seconds', 'olympus-google-fonts' ), $seconds );
|
126 |
-
} elseif ( $seconds > 0 ) {
|
127 |
-
return __( 'a second', 'olympus-google-fonts' );
|
128 |
-
}
|
129 |
}
|
130 |
|
131 |
/**
|
@@ -237,7 +213,7 @@ if ( ! class_exists( 'OGF_Feedback' ) ) :
|
|
237 |
<div class="notice updated ogf-notice">
|
238 |
<div class="ogf-notice-inner">
|
239 |
<div class="ogf-notice-icon">
|
240 |
-
<img src="https://ps.w.org/olympus-google-fonts/assets/icon-256x256.jpg" alt="<?php echo esc_attr__( '
|
241 |
</div>
|
242 |
<div class="ogf-notice-content">
|
243 |
<h3><?php echo esc_html__( 'Are you enjoying using Google Fonts?', 'olympus-google-fonts' ); ?></h3>
|
7 |
* https://winwar.co.uk/2014/10/ask-wordpress-plugin-reviews-week/
|
8 |
*
|
9 |
* @package olympus-google-fonts
|
10 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
11 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
12 |
*/
|
13 |
|
102 |
} elseif ( $days > 0 ) {
|
103 |
return __( 'a day', 'olympus-google-fonts' );
|
104 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
|
107 |
/**
|
213 |
<div class="notice updated ogf-notice">
|
214 |
<div class="ogf-notice-inner">
|
215 |
<div class="ogf-notice-icon">
|
216 |
+
<img src="https://ps.w.org/olympus-google-fonts/assets/icon-256x256.jpg" alt="<?php echo esc_attr__( 'Google Fonts WordPress Plugin', 'olympus-google-fonts' ); ?>" />
|
217 |
</div>
|
218 |
<div class="ogf-notice-content">
|
219 |
<h3><?php echo esc_html__( 'Are you enjoying using Google Fonts?', 'olympus-google-fonts' ); ?></h3>
|
includes/class-ogf-fonts.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Build the URL to load the chosen Google Fonts.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
@@ -30,8 +30,10 @@ class OGF_Fonts {
|
|
30 |
* Let's get started.
|
31 |
*/
|
32 |
public function __construct() {
|
|
|
33 |
$this->google_fonts = ogf_fonts_array();
|
34 |
$this->get_choices();
|
|
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -65,6 +67,7 @@ class OGF_Fonts {
|
|
65 |
public function get_font_id( $font ) {
|
66 |
|
67 |
return str_replace( ' ', '+', $font );
|
|
|
68 |
}
|
69 |
|
70 |
/**
|
@@ -74,7 +77,15 @@ class OGF_Fonts {
|
|
74 |
*/
|
75 |
public function get_font_weights( $font_id ) {
|
76 |
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
}
|
80 |
|
@@ -110,12 +121,19 @@ class OGF_Fonts {
|
|
110 |
*/
|
111 |
public function filter_selected_weights( $font_id, $weights ) {
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
$selected_weights = get_theme_mod( $font_id . '_weights', false );
|
114 |
|
115 |
if ( ! $selected_weights ) {
|
116 |
return $weights;
|
117 |
}
|
118 |
return array_intersect_key( $weights, array_flip( $selected_weights ) );
|
|
|
119 |
}
|
120 |
|
121 |
/**
|
3 |
* Build the URL to load the chosen Google Fonts.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
30 |
* Let's get started.
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
+
|
34 |
$this->google_fonts = ogf_fonts_array();
|
35 |
$this->get_choices();
|
36 |
+
|
37 |
}
|
38 |
|
39 |
/**
|
67 |
public function get_font_id( $font ) {
|
68 |
|
69 |
return str_replace( ' ', '+', $font );
|
70 |
+
|
71 |
}
|
72 |
|
73 |
/**
|
77 |
*/
|
78 |
public function get_font_weights( $font_id ) {
|
79 |
|
80 |
+
$weights = $this->google_fonts[ $font_id ]['variants'];
|
81 |
+
|
82 |
+
unset( $weights['0'] );
|
83 |
+
|
84 |
+
foreach ( $weights as $key => $value ) {
|
85 |
+
$weights[ $key . 'i' ] = $value . ' Italic';
|
86 |
+
}
|
87 |
+
|
88 |
+
return $weights;
|
89 |
|
90 |
}
|
91 |
|
121 |
*/
|
122 |
public function filter_selected_weights( $font_id, $weights ) {
|
123 |
|
124 |
+
unset( $weights['0'] );
|
125 |
+
|
126 |
+
foreach ( $weights as $key => $value ) {
|
127 |
+
$weights[ $key . 'i' ] = $value . ' Italic';
|
128 |
+
}
|
129 |
+
|
130 |
$selected_weights = get_theme_mod( $font_id . '_weights', false );
|
131 |
|
132 |
if ( ! $selected_weights ) {
|
133 |
return $weights;
|
134 |
}
|
135 |
return array_intersect_key( $weights, array_flip( $selected_weights ) );
|
136 |
+
|
137 |
}
|
138 |
|
139 |
/**
|
includes/class-ogf-welcome.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Welcome Notice Class.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
@@ -66,18 +66,21 @@ if ( ! class_exists( 'OGF_Welcome' ) ) :
|
|
66 |
* AJAX handler to store the state of dismissible notices.
|
67 |
*/
|
68 |
public function dismiss_notice() {
|
|
|
69 |
if ( isset( $_POST['type'] ) ) {
|
70 |
// Pick up the notice "type" - passed via jQuery (the "data-notice" attribute on the notice).
|
71 |
$type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
|
72 |
// Store it in the options table.
|
73 |
update_option( 'dismissed-' . $type, true );
|
74 |
}
|
|
|
75 |
}
|
76 |
|
77 |
/**
|
78 |
* Display the admin notice.
|
79 |
*/
|
80 |
public function display_admin_notice() {
|
|
|
81 |
if ( get_option( 'dismissed-' . $this->slug, false ) ) {
|
82 |
return;
|
83 |
}
|
@@ -92,6 +95,7 @@ if ( ! class_exists( 'OGF_Welcome' ) ) :
|
|
92 |
</div>
|
93 |
<?php
|
94 |
}
|
|
|
95 |
}
|
96 |
endif;
|
97 |
|
3 |
* Welcome Notice Class.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
66 |
* AJAX handler to store the state of dismissible notices.
|
67 |
*/
|
68 |
public function dismiss_notice() {
|
69 |
+
|
70 |
if ( isset( $_POST['type'] ) ) {
|
71 |
// Pick up the notice "type" - passed via jQuery (the "data-notice" attribute on the notice).
|
72 |
$type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
|
73 |
// Store it in the options table.
|
74 |
update_option( 'dismissed-' . $type, true );
|
75 |
}
|
76 |
+
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
* Display the admin notice.
|
81 |
*/
|
82 |
public function display_admin_notice() {
|
83 |
+
|
84 |
if ( get_option( 'dismissed-' . $this->slug, false ) ) {
|
85 |
return;
|
86 |
}
|
95 |
</div>
|
96 |
<?php
|
97 |
}
|
98 |
+
|
99 |
}
|
100 |
endif;
|
101 |
|
includes/customizer/controls/class-ogf-customize-multiple-checkbox-control.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Multiple Checkbox Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Multiple Checkbox Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/customizer/controls/class-ogf-customize-panel.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Customize Repeater Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Customize Repeater Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/customizer/controls/class-ogf-customize-repeater-control.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Customize Repeater Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Customize Repeater Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/customizer/controls/class-ogf-customize-typography-control.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Typography Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Typography Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/customizer/controls/class-ogf-customize-upsell-control.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Upsell Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Upsell Custom Control
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/customizer/output-css.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Output the Google Fonts CSS.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
@@ -37,6 +37,7 @@ add_action( 'wp_head', 'ogf_output_css' );
|
|
37 |
* @param string $option_name The option name to pull from the database.
|
38 |
*/
|
39 |
function ogf_generate_css( $selector, $option_name ) {
|
|
|
40 |
$family = get_theme_mod( $option_name . '_font', false );
|
41 |
$font_size = get_theme_mod( $option_name . '_font_size', false );
|
42 |
$line_height = get_theme_mod( $option_name . '_line_height', false );
|
@@ -108,6 +109,7 @@ function ogf_generate_css( $selector, $option_name ) {
|
|
108 |
echo wp_kses_post( $return );
|
109 |
|
110 |
}
|
|
|
111 |
}
|
112 |
|
113 |
/**
|
@@ -117,6 +119,7 @@ function ogf_generate_css( $selector, $option_name ) {
|
|
117 |
* @return string The built font stack.
|
118 |
*/
|
119 |
function ogf_build_font_stack( $font_id ) {
|
|
|
120 |
$google_fonts = ogf_fonts_array();
|
121 |
|
122 |
if ( array_key_exists( $font_id, $google_fonts ) ) {
|
@@ -133,6 +136,7 @@ function ogf_build_font_stack( $font_id ) {
|
|
133 |
* Check if the styles should be forced.
|
134 |
*/
|
135 |
function ogf_is_forced() {
|
|
|
136 |
if ( 1 === (int) get_theme_mod( 'ogf_force_styles' ) ) {
|
137 |
return ' !important';
|
138 |
}
|
3 |
* Output the Google Fonts CSS.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
37 |
* @param string $option_name The option name to pull from the database.
|
38 |
*/
|
39 |
function ogf_generate_css( $selector, $option_name ) {
|
40 |
+
|
41 |
$family = get_theme_mod( $option_name . '_font', false );
|
42 |
$font_size = get_theme_mod( $option_name . '_font_size', false );
|
43 |
$line_height = get_theme_mod( $option_name . '_line_height', false );
|
109 |
echo wp_kses_post( $return );
|
110 |
|
111 |
}
|
112 |
+
|
113 |
}
|
114 |
|
115 |
/**
|
119 |
* @return string The built font stack.
|
120 |
*/
|
121 |
function ogf_build_font_stack( $font_id ) {
|
122 |
+
|
123 |
$google_fonts = ogf_fonts_array();
|
124 |
|
125 |
if ( array_key_exists( $font_id, $google_fonts ) ) {
|
136 |
* Check if the styles should be forced.
|
137 |
*/
|
138 |
function ogf_is_forced() {
|
139 |
+
|
140 |
if ( 1 === (int) get_theme_mod( 'ogf_force_styles' ) ) {
|
141 |
return ' !important';
|
142 |
}
|
includes/customizer/panels.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Add multi-level panel functionality.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
3 |
* Add multi-level panel functionality.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
includes/customizer/settings.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Register the customizer settings.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
@@ -153,7 +153,7 @@ function ogf_customize_register( $wp_customize ) {
|
|
153 |
$wp_customize->add_setting(
|
154 |
$font_id . '_weights',
|
155 |
array(
|
156 |
-
'default' => array( '100', '200', '300', '400', '500', '600', '700', '800', '900' ),
|
157 |
'transport' => 'refresh',
|
158 |
)
|
159 |
);
|
3 |
* Register the customizer settings.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
153 |
$wp_customize->add_setting(
|
154 |
$font_id . '_weights',
|
155 |
array(
|
156 |
+
'default' => array( '100', '200', '300', '400', '500', '600', '700', '800', '900', '100i', '200i', '300i', '400i', '500i', '600i', '700i', '800i', '900i' ),
|
157 |
'transport' => 'refresh',
|
158 |
)
|
159 |
);
|
includes/functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Helper functions.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
-
* @copyright Copyright (c)
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
@@ -11,16 +11,21 @@
|
|
11 |
* An array of user-defined elements that can be customized using the plugin.
|
12 |
*/
|
13 |
function ogf_get_custom_elements() {
|
|
|
14 |
$theme_mod = get_theme_mod( 'ogf_custom_selectors', false );
|
|
|
15 |
if ( ! $theme_mod ) {
|
16 |
return array();
|
17 |
}
|
|
|
18 |
$custom_selectors = json_decode( $theme_mod, true );
|
19 |
|
20 |
foreach ( $custom_selectors as &$selector ) {
|
21 |
$selector['section'] = 'ogf_advanced__custom';
|
22 |
}
|
|
|
23 |
return $custom_selectors;
|
|
|
24 |
}
|
25 |
|
26 |
/**
|
@@ -202,12 +207,14 @@ function ogf_fonts_array() {
|
|
202 |
}
|
203 |
|
204 |
return $fonts;
|
|
|
205 |
}
|
206 |
|
207 |
/**
|
208 |
* Build the array for the select choices setting.
|
209 |
*/
|
210 |
function ogf_font_choices_for_select() {
|
|
|
211 |
$fonts_array = ogf_fonts_array();
|
212 |
|
213 |
$fonts = array(
|
3 |
* Helper functions.
|
4 |
*
|
5 |
* @package olympus-google-fonts
|
6 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
*/
|
9 |
|
11 |
* An array of user-defined elements that can be customized using the plugin.
|
12 |
*/
|
13 |
function ogf_get_custom_elements() {
|
14 |
+
|
15 |
$theme_mod = get_theme_mod( 'ogf_custom_selectors', false );
|
16 |
+
|
17 |
if ( ! $theme_mod ) {
|
18 |
return array();
|
19 |
}
|
20 |
+
|
21 |
$custom_selectors = json_decode( $theme_mod, true );
|
22 |
|
23 |
foreach ( $custom_selectors as &$selector ) {
|
24 |
$selector['section'] = 'ogf_advanced__custom';
|
25 |
}
|
26 |
+
|
27 |
return $custom_selectors;
|
28 |
+
|
29 |
}
|
30 |
|
31 |
/**
|
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(
|
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.
|
9 |
* Author: Danny Cooper
|
10 |
* Author URI: https://fontsplugin.com
|
11 |
* Text Domain: olympus-google-fonts
|
@@ -14,11 +14,11 @@
|
|
14 |
* Domain Path: /languages
|
15 |
*
|
16 |
* @package olympus-google-fonts
|
17 |
-
* @copyright Copyright (c)
|
18 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
19 |
*/
|
20 |
|
21 |
-
define( 'OGF_VERSION', '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.5.0
|
9 |
* Author: Danny Cooper
|
10 |
* Author URI: https://fontsplugin.com
|
11 |
* Text Domain: olympus-google-fonts
|
14 |
* Domain Path: /languages
|
15 |
*
|
16 |
* @package olympus-google-fonts
|
17 |
+
* @copyright Copyright (c) 2019, Danny Cooper
|
18 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
19 |
*/
|
20 |
|
21 |
+
define( 'OGF_VERSION', '1.5.0' );
|
22 |
define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
23 |
define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
|
24 |
|
readme.txt
CHANGED
@@ -5,12 +5,12 @@ Donate link: https://fontsplugin.com/#pricing
|
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.0
|
7 |
License: GPLv2 or later
|
8 |
-
Stable tag: 1.
|
9 |
|
10 |
-
The easiest to use Google Fonts
|
11 |
|
12 |
== Description ==
|
13 |
-
The Google Fonts library currently contains 877 unique fonts. This plugin allows you to easily use any of them on your WordPress website.
|
14 |
|
15 |
You're not stuck with one font for the entire website, you can easily choose one font for headings and another for your content.
|
16 |
|
@@ -31,7 +31,11 @@ The full Google Fonts library can be found here - [Google Fonts](https://fonts.g
|
|
31 |
* Efficient Font Loading using a single request.
|
32 |
* **SEO-Friendly** (Search Engine Optimization).
|
33 |
* Tested with **PHP7**
|
|
|
34 |
|
|
|
|
|
|
|
35 |
|
36 |
The Google Fonts for WordPress plugin will work with all WordPress themes and has been specifically tested with the following:
|
37 |
|
@@ -41,10 +45,17 @@ The Google Fonts for WordPress plugin will work with all WordPress themes and ha
|
|
41 |
* TwentySixteen
|
42 |
* TwentySeventeen
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
= Bugs =
|
45 |
If you find an issue with Google Fonts for WordPress, let us know [here](https://github.com/DannyCooper/olympus-google-fonts/issues)!
|
46 |
|
47 |
-
|
48 |
= Google Fonts Gutenberg Block =
|
49 |
Add some flair to your content with our new Gutenberg block.
|
50 |
|
@@ -81,6 +92,10 @@ We are 99.99% certain it will, if it doesn't then please create a [support ticke
|
|
81 |
|
82 |
== Changelog ==
|
83 |
|
|
|
|
|
|
|
|
|
84 |
= 1.4.8 =
|
85 |
|
86 |
* Improve theme compatibility
|
@@ -116,107 +131,3 @@ We are 99.99% certain it will, if it doesn't then please create a [support ticke
|
|
116 |
|
117 |
* Fix previewer not showing fonts
|
118 |
* Add new fonts
|
119 |
-
|
120 |
-
= 1.4.0 =
|
121 |
-
|
122 |
-
* Substantial performance improvements
|
123 |
-
* Improved organization of settings
|
124 |
-
|
125 |
-
= 1.3.2 =
|
126 |
-
|
127 |
-
* Add welcome notice.
|
128 |
-
|
129 |
-
= 1.3.1 =
|
130 |
-
|
131 |
-
* Update font list.
|
132 |
-
* Add version strings to resources.
|
133 |
-
* Add deactivation survey.
|
134 |
-
|
135 |
-
= 1.3.0 =
|
136 |
-
|
137 |
-
* Add 'Force Styles' setting to the bottom of 'Advanced Settings'.
|
138 |
-
|
139 |
-
= 1.2.5 =
|
140 |
-
|
141 |
-
* Improve theme compatibility.
|
142 |
-
|
143 |
-
= 1.2.4 =
|
144 |
-
|
145 |
-
* Improve customizer CSS.
|
146 |
-
* Improve Javascript code.
|
147 |
-
|
148 |
-
= 1.2.3 =
|
149 |
-
|
150 |
-
* Improve CSS for post/page headings and content.
|
151 |
-
|
152 |
-
= 1.2.2 =
|
153 |
-
|
154 |
-
* Minor updates
|
155 |
-
|
156 |
-
= 1.2.1 =
|
157 |
-
|
158 |
-
* Remove unused code
|
159 |
-
|
160 |
-
= 1.2.0 =
|
161 |
-
|
162 |
-
* Add new fonts
|
163 |
-
* Add font-weight option
|
164 |
-
* Add font-style option
|
165 |
-
* Improve live preview
|
166 |
-
* Add settings link to plugins page
|
167 |
-
* Add searchable text field to font-family setting
|
168 |
-
* Remove 'force styles' setting
|
169 |
-
|
170 |
-
= 1.1.2 =
|
171 |
-
|
172 |
-
* Add feedback request
|
173 |
-
|
174 |
-
= 1.1.1 =
|
175 |
-
|
176 |
-
* Add new fonts
|
177 |
-
|
178 |
-
= 1.1.0 =
|
179 |
-
|
180 |
-
* Improve outputting of Google stylesheet
|
181 |
-
|
182 |
-
= 1.0.9 =
|
183 |
-
|
184 |
-
* Fix navigation font setting
|
185 |
-
|
186 |
-
= 1.0.8 =
|
187 |
-
|
188 |
-
* Fix compatibility issue with PHP 5.2
|
189 |
-
|
190 |
-
= 1.0.7 =
|
191 |
-
|
192 |
-
* Add advanced settings
|
193 |
-
|
194 |
-
= 1.0.6 =
|
195 |
-
|
196 |
-
* Minor code improvements
|
197 |
-
|
198 |
-
= 1.0.5 =
|
199 |
-
|
200 |
-
* Add force styles option
|
201 |
-
|
202 |
-
= 1.0.3 =
|
203 |
-
|
204 |
-
* Rewrite readme
|
205 |
-
|
206 |
-
= 1.0.3 =
|
207 |
-
|
208 |
-
* Rename to adhere to guidelines
|
209 |
-
|
210 |
-
= 1.0.2 =
|
211 |
-
|
212 |
-
* Refactor get_choices in class-google-url.php
|
213 |
-
|
214 |
-
= 1.0.1 =
|
215 |
-
|
216 |
-
* Fix bug in class-google-url.php
|
217 |
-
* Add missing translation
|
218 |
-
* Add .pot file for translators
|
219 |
-
|
220 |
-
= 1.0.0 =
|
221 |
-
|
222 |
-
* Initial release of Google Fonts for WordPress
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.0
|
7 |
License: GPLv2 or later
|
8 |
+
Stable tag: 1.5.0
|
9 |
|
10 |
+
The easiest to use Google Fonts Plugin. No coding required. 870+ font choices.
|
11 |
|
12 |
== Description ==
|
13 |
+
The [Google Fonts](https://fontsplugin.com/?utm_source=wporg&utm_campaign=intro) library currently contains 877 unique fonts. This plugin allows you to easily use any of them on your WordPress website.
|
14 |
|
15 |
You're not stuck with one font for the entire website, you can easily choose one font for headings and another for your content.
|
16 |
|
31 |
* Efficient Font Loading using a single request.
|
32 |
* **SEO-Friendly** (Search Engine Optimization).
|
33 |
* Tested with **PHP7**
|
34 |
+
* Selective Font Loading
|
35 |
|
36 |
+
> Note: some features are Premium. Which means you need to upgrade to unlock those features. You can upgrade here: [Google Fonts Pro](https://fontsplugin.com/upgrade/?utm_source=wporg&utm_campaign=upgrade)
|
37 |
+
|
38 |
+
= Plugin Compatibility =
|
39 |
|
40 |
The Google Fonts for WordPress plugin will work with all WordPress themes and has been specifically tested with the following:
|
41 |
|
45 |
* TwentySixteen
|
46 |
* TwentySeventeen
|
47 |
|
48 |
+
### Further Reading
|
49 |
+
|
50 |
+
For more info on search engine optimization, check out the following:
|
51 |
+
|
52 |
+
* [Documentation](https://fontsplugin.com/docs/)
|
53 |
+
* [Font Combinations](https://fontsplugin.com/font-combinations/)
|
54 |
+
* [How to Use Google Fonts in WordPress](https://fontsplugin.com/wordpress-google-fonts/)
|
55 |
+
|
56 |
= Bugs =
|
57 |
If you find an issue with Google Fonts for WordPress, let us know [here](https://github.com/DannyCooper/olympus-google-fonts/issues)!
|
58 |
|
|
|
59 |
= Google Fonts Gutenberg Block =
|
60 |
Add some flair to your content with our new Gutenberg block.
|
61 |
|
92 |
|
93 |
== Changelog ==
|
94 |
|
95 |
+
= 1.5.0 =
|
96 |
+
|
97 |
+
* Fix problem with italics not being loaded.
|
98 |
+
|
99 |
= 1.4.8 =
|
100 |
|
101 |
* Improve theme compatibility
|
131 |
|
132 |
* Fix previewer not showing fonts
|
133 |
* Add new fonts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|