Custom Adobe Fonts (Typekit) - Version 1.0.5

Version Description

Download this release

Release Info

Developer Nikschavan
Plugin Icon 128x128 Custom Adobe Fonts (Typekit)
Version 1.0.5
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.5

classes/class-custom-typekit-fonts-admin.php CHANGED
@@ -105,13 +105,6 @@ if ( ! class_exists( 'Custom_Typekit_Fonts_Admin' ) ) :
105
  public function register_custom_fonts_menu() {
106
 
107
  $title = apply_filters( 'custom_typekit_fonts_menu_title', __( 'Typekit Fonts', 'custom-typekit-fonts' ) );
108
- add_options_page(
109
- $title,
110
- $title,
111
- 'edit_theme_options',
112
- 'custom-typekit-fonts',
113
- array( $this, 'typekit_options_page' )
114
- );
115
 
116
  add_submenu_page(
117
  'themes.php',
105
  public function register_custom_fonts_menu() {
106
 
107
  $title = apply_filters( 'custom_typekit_fonts_menu_title', __( 'Typekit Fonts', 'custom-typekit-fonts' ) );
 
 
 
 
 
 
 
108
 
109
  add_submenu_page(
110
  'themes.php',
classes/class-custom-typekit-fonts-render.php CHANGED
@@ -30,6 +30,16 @@ if ( ! class_exists( 'Custom_Typekit_Fonts_Render' ) ) :
30
  */
31
  protected $font_css;
32
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Instance of Bsf_Custom_Fonts_Admin.
35
  *
@@ -61,7 +71,44 @@ if ( ! class_exists( 'Custom_Typekit_Fonts_Render' ) ) :
61
  add_filter( 'fl_theme_system_fonts', array( $this, 'bb_custom_fonts' ) );
62
  add_filter( 'fl_builder_font_families_system', array( $this, 'bb_custom_fonts' ) );
63
  // Elementor page builder.
64
- add_action( 'elementor/controls/controls_registered', array( $this, 'elementor_custom_fonts' ), 10, 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
  /**
@@ -172,27 +219,6 @@ if ( ! class_exists( 'Custom_Typekit_Fonts_Render' ) ) :
172
 
173
  return array_merge( $bb_fonts, $custom_fonts );
174
  }
175
-
176
- /**
177
- * Add Custom Font list to Elementor Page Builder
178
- *
179
- * @since 1.0.3
180
- * @param array $controls_registry font families added by elementor.
181
- */
182
- function elementor_custom_fonts( $controls_registry ) {
183
- $kit_list = get_option( 'custom-typekit-fonts' );
184
- $fonts = $kit_list['custom-typekit-font-details'];
185
- $fonts_elementor = array( 'Use Any Fonts' => array() );
186
- if ( ! empty( $fonts ) ) :
187
- foreach ( $fonts as $font_family_name => $fonts_url ) :
188
- $fonts_elementor[ $font_family_name ] = 'system';
189
- endforeach;
190
- endif;
191
-
192
- $fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' );
193
- $new_fonts = array_merge( $fonts, $fonts_elementor );
194
- $controls_registry->get_control( 'font' )->set_settings( 'options', $new_fonts );
195
- }
196
  }
197
 
198
  /**
30
  */
31
  protected $font_css;
32
 
33
+ /**
34
+ * Font base.
35
+ *
36
+ * This is used in case of Elementor's Font param
37
+ *
38
+ * @since 1.0.4
39
+ * @var string
40
+ */
41
+ private static $font_base = 'custom-typekit-fonts';
42
+
43
  /**
44
  * Instance of Bsf_Custom_Fonts_Admin.
45
  *
71
  add_filter( 'fl_theme_system_fonts', array( $this, 'bb_custom_fonts' ) );
72
  add_filter( 'fl_builder_font_families_system', array( $this, 'bb_custom_fonts' ) );
73
  // Elementor page builder.
74
+ add_filter( 'elementor/fonts/groups', array( $this, 'elementor_group' ) );
75
+ add_filter( 'elementor/fonts/additional_fonts', array( $this, 'add_elementor_fonts' ) );
76
+ }
77
+
78
+ /**
79
+ * Add Custom Font group to elementor font list.
80
+ *
81
+ * Group name "Custom" is added as the first element in the array.
82
+ *
83
+ * @since 1.0.4
84
+ * @param Array $font_groups default font groups in elementor.
85
+ * @return Array Modified font groups with newly added font group.
86
+ */
87
+ public function elementor_group( $font_groups ) {
88
+ $new_group[ self::$font_base ] = __( 'Typekit Fonts', 'custom-typekit-fonts' );
89
+ $font_groups = $new_group + $font_groups;
90
+
91
+ return $font_groups;
92
+ }
93
+
94
+ /**
95
+ * Add Custom Fonts to the Elementor Page builder's font param.
96
+ *
97
+ * @since 1.0.4
98
+ * @param Array $fonts Custom Font's array.
99
+ */
100
+ public function add_elementor_fonts( $fonts ) {
101
+
102
+ $kit_list = get_option( 'custom-typekit-fonts' );
103
+ $fonts = $kit_list['custom-typekit-font-details'];
104
+
105
+ if ( ! empty( $fonts ) ) {
106
+ foreach ( $fonts as $font_family_name => $fonts_url ) {
107
+ $fonts[ $font_family_name ] = self::$font_base;
108
+ }
109
+ }
110
+
111
+ return $fonts;
112
  }
113
 
114
  /**
219
 
220
  return array_merge( $bb_fonts, $custom_fonts );
221
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  }
223
 
224
  /**
custom-typekit-fonts.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: Brainstorm Force
7
  * Author URI: http://www.brainstormforce.com
8
  * Text Domain: custom-typekit-fonts
9
- * Version: 1.0.3
10
  *
11
  * @package Typekit_Custom_Fonts
12
  */
@@ -25,7 +25,7 @@ define( 'CUSTOM_TYPEKIT_FONTS_FILE', __FILE__ );
25
  define( 'CUSTOM_TYPEKIT_FONTS_BASE', plugin_basename( CUSTOM_TYPEKIT_FONTS_FILE ) );
26
  define( 'CUSTOM_TYPEKIT_FONTS_DIR', plugin_dir_path( CUSTOM_TYPEKIT_FONTS_FILE ) );
27
  define( 'CUSTOM_TYPEKIT_FONTS_URI', plugins_url( '/', CUSTOM_TYPEKIT_FONTS_FILE ) );
28
- define( 'CUSTOM_TYPEKIT_FONTS_VER', '1.0.3' );
29
  /**
30
  * BSF Custom Fonts
31
  */
6
  * Author: Brainstorm Force
7
  * Author URI: http://www.brainstormforce.com
8
  * Text Domain: custom-typekit-fonts
9
+ * Version: 1.0.5
10
  *
11
  * @package Typekit_Custom_Fonts
12
  */
25
  define( 'CUSTOM_TYPEKIT_FONTS_BASE', plugin_basename( CUSTOM_TYPEKIT_FONTS_FILE ) );
26
  define( 'CUSTOM_TYPEKIT_FONTS_DIR', plugin_dir_path( CUSTOM_TYPEKIT_FONTS_FILE ) );
27
  define( 'CUSTOM_TYPEKIT_FONTS_URI', plugins_url( '/', CUSTOM_TYPEKIT_FONTS_FILE ) );
28
+ define( 'CUSTOM_TYPEKIT_FONTS_VER', '1.0.5' );
29
  /**
30
  * BSF Custom Fonts
31
  */
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Custom Typekit Fonts ===
2
  Contributors: brainstormforce, rushijagani
3
  Donate link: https://wpastra.com/
4
- Tags: Beaver Builder, Elementor, Astra, Typekit, Custom Fonts, Font, Typography
5
  Requires at least: 4.4
6
  Tested up to: 4.9.4
7
- Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -49,6 +49,12 @@ If you're not using any of the supported plugins and theme, you can write the cu
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
52
  v1.0.3
53
  * New: Added compatibility with Beaver Builder Theme, Beaver Builder Plugin and Elementor.
54
 
1
  === Custom Typekit Fonts ===
2
  Contributors: brainstormforce, rushijagani
3
  Donate link: https://wpastra.com/
4
+ Tags: custom typekit fonts, theme custom fonts, unlimited typekit custom fonts
5
  Requires at least: 4.4
6
  Tested up to: 4.9.4
7
+ Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
49
 
50
  == Changelog ==
51
 
52
+ v1.0.5
53
+ * Fixed: Fatal error: Uncaught Error: Class ‘Bsf_Custom_Fonts_Taxonomy’ not found
54
+
55
+ v1.0.4
56
+ * Fixed: Added Fonts in separate group for Elementor fonts & global fonts selection.
57
+
58
  v1.0.3
59
  * New: Added compatibility with Beaver Builder Theme, Beaver Builder Plugin and Elementor.
60
 
templates/custom-typekit-fonts-options.php CHANGED
@@ -8,7 +8,7 @@
8
  $kit_info = get_option( 'custom-typekit-fonts' );
9
  ?>
10
  <div class="wrap">
11
- <h2><?php esc_html_e( 'Typekit', 'custom-typekit-fonts' ); ?></h2>
12
  <div id="poststuff">
13
  <div id="post-body" class="metabox-holder columns-2 typekit-custom-fonts-wrap">
14
  <div id="post-body-content">
8
  $kit_info = get_option( 'custom-typekit-fonts' );
9
  ?>
10
  <div class="wrap">
11
+ <h2><?php esc_html_e( 'Typekit Fonts', 'custom-typekit-fonts' ); ?></h2>
12
  <div id="poststuff">
13
  <div id="post-body" class="metabox-holder columns-2 typekit-custom-fonts-wrap">
14
  <div id="post-body-content">