Custom Icons for Elementor - Version 0.1.4

Version Description

  • Fix the "empty box" icon error seen on some sites. Please reupload any affected fonts and regen your css.
Download this release

Release Info

Developer michaelbourne
Plugin Icon 128x128 Custom Icons for Elementor
Version 0.1.4
Comparing to
See all releases

Code changes from version 0.1.3 to 0.1.4

Files changed (2) hide show
  1. README.txt +8 -2
  2. elementor-custom-icons.php +11 -11
README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/yycpro
4
  Tags: elementor, icons, fontello, icon fonts
5
  Requires at least: 4.5
6
  Tested up to: 4.9.8
7
- Stable tag: 0.1.3
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
@@ -12,7 +12,7 @@ Add custom icon fonts and SVGs to the built in Elementor icon controls
12
 
13
  == Description ==
14
 
15
- Enables the user to add their own custom icons to the built in Elementor icon controls and elements, thereby removing the reliance on FontAwesome and providing a better opportunity for branding with custom icon sets on your websites. Works exclusively through the use of Fontello's free icon font service. [](http://coderisk.com/wp/plugin/custom-icons-for-elementor/RIPS-iGehTiClE3)
16
 
17
  = Plugin Features =
18
 
@@ -58,6 +58,9 @@ None yet
58
 
59
  == Changelog ==
60
 
 
 
 
61
  = 0.1.3 =
62
  * Fix error where an un-named font will not render properly
63
  * Edit content directory reference
@@ -80,6 +83,9 @@ None yet
80
 
81
  == Upgrade Notice ==
82
 
 
 
 
83
  = 0.1.3 =
84
  Fix un-named font errors
85
 
4
  Tags: elementor, icons, fontello, icon fonts
5
  Requires at least: 4.5
6
  Tested up to: 4.9.8
7
+ Stable tag: 0.1.4
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
12
 
13
  == Description ==
14
 
15
+ Enables the user to add their own custom icons to the built in Elementor icon controls and elements, thereby removing the reliance on FontAwesome and providing a better opportunity for branding with custom icon sets on your websites. Works exclusively through the use of Fontello's free icon font service.
16
 
17
  = Plugin Features =
18
 
58
 
59
  == Changelog ==
60
 
61
+ = 0.1.4 =
62
+ * Fix the "empty box" icon error seen on some sites. Please reupload any affected fonts and regen your css.
63
+
64
  = 0.1.3 =
65
  * Fix error where an un-named font will not render properly
66
  * Edit content directory reference
83
 
84
  == Upgrade Notice ==
85
 
86
+ = 0.1.4 =
87
+ Fix broken icons on some sites. Font re-upload and regen required if you're affected.
88
+
89
  = 0.1.3 =
90
  Fix un-named font errors
91
 
elementor-custom-icons.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Custom Icons for Elementor
4
  Description: Add custom icon fonts to the built in Elementor controls
5
- Version: 0.1.3
6
  Author: Michael Bourne
7
  Author URI: https://michaelbourne.ca
8
  License: GPL3
@@ -59,11 +59,11 @@ if ( ! class_exists( 'ECIcons' ) ) {
59
  private $upload_url;
60
 
61
  /**
62
- * WP-CONTENT folder name
63
  *
64
- * @var $content_dir
65
  */
66
- private $content_dir;
67
 
68
  /**
69
  * Prefix for custom icons
@@ -118,10 +118,10 @@ if ( ! class_exists( 'ECIcons' ) ) {
118
  $this->prefix_icon = 'efs-';
119
  $this->upload_dir = $upload['basedir'] . '/elementor_icons_files';
120
  $this->upload_url = $upload['baseurl'] . '/elementor_icons_files';
121
- $this->content_dir = ( defined(WP_CONTENT_DIR) ) ? WP_CONTENT_DIR : str_replace( get_option('siteurl'), '', content_url() );
122
 
123
  // set plugin version
124
- $this->version = '0.1.3';
125
 
126
  // SSL fix because WordPress core function wp_upload_dir() doesn't check protocol.
127
  if ( is_ssl() ) $this->upload_url = str_replace( 'http://', 'https://', $this->upload_url );
@@ -292,14 +292,14 @@ if ( ! class_exists( 'ECIcons' ) ) {
292
  }
293
 
294
  if ( is_string( $file ) && strpos( $file, 'css' ) !== false ) {
295
- $file_part = explode( $this->content_dir, $file );
296
  $data['css_folder'] = $file;
297
  $css_folder = $file_part[1];
298
  }
299
 
300
  if ( is_string( $file ) && strpos( $file, 'font' ) !== false ) {
301
- $file_part = explode( $this->content_dir, $file );
302
- $data['font_url'] = content_url() . $file_part[1];
303
  }
304
 
305
  }
@@ -308,10 +308,10 @@ if ( ! class_exists( 'ECIcons' ) ) {
308
  $data['name'] = 'font' . mt_rand();
309
  $data['nameempty'] = true;
310
  $data['css_root'] = $data['css_folder'] . '/fontello.css';
311
- $data['css_url'] = content_url() . $css_folder . '/fontello.css';
312
  } else {
313
  $data['css_root'] = $data['css_folder'] . '/' . $data['name'] . '.css';
314
- $data['css_url'] = content_url() . $css_folder . '/' . $data['name'] . '.css';
315
  }
316
 
317
 
2
  /*
3
  Plugin Name: Custom Icons for Elementor
4
  Description: Add custom icon fonts to the built in Elementor controls
5
+ Version: 0.1.4
6
  Author: Michael Bourne
7
  Author URI: https://michaelbourne.ca
8
  License: GPL3
59
  private $upload_url;
60
 
61
  /**
62
+ * uploads folder name
63
  *
64
+ * @var $upload_dir_single
65
  */
66
+ private $upload_dir_single;
67
 
68
  /**
69
  * Prefix for custom icons
118
  $this->prefix_icon = 'efs-';
119
  $this->upload_dir = $upload['basedir'] . '/elementor_icons_files';
120
  $this->upload_url = $upload['baseurl'] . '/elementor_icons_files';
121
+ $this->upload_dir_single = str_replace( get_option('siteurl'), '', $this->upload_url );
122
 
123
  // set plugin version
124
+ $this->version = '0.1.4';
125
 
126
  // SSL fix because WordPress core function wp_upload_dir() doesn't check protocol.
127
  if ( is_ssl() ) $this->upload_url = str_replace( 'http://', 'https://', $this->upload_url );
292
  }
293
 
294
  if ( is_string( $file ) && strpos( $file, 'css' ) !== false ) {
295
+ $file_part = explode( $this->upload_dir_single, $file );
296
  $data['css_folder'] = $file;
297
  $css_folder = $file_part[1];
298
  }
299
 
300
  if ( is_string( $file ) && strpos( $file, 'font' ) !== false ) {
301
+ $file_part = explode( $this->upload_dir_single, $file );
302
+ $data['font_url'] = $this->upload_url . $file_part[1];
303
  }
304
 
305
  }
308
  $data['name'] = 'font' . mt_rand();
309
  $data['nameempty'] = true;
310
  $data['css_root'] = $data['css_folder'] . '/fontello.css';
311
+ $data['css_url'] = $this->upload_url . $css_folder . '/fontello.css';
312
  } else {
313
  $data['css_root'] = $data['css_folder'] . '/' . $data['name'] . '.css';
314
+ $data['css_url'] = $this->upload_url . $css_folder . '/' . $data['name'] . '.css';
315
  }
316
 
317