Version Description
- Supress PHP warning if Fontello file can't be read by server
- Add URL fallback for Fontello file reading (some servers are setup in a way that prevents server path reading)
- Fix "empty Fontello file name" issues by defaulting to ZIP file name instead of random string, thereby fixing the "disappearing icons" in unnamed files
- Fix CSS issues in editor and icon lists
Download this release
Release Info
Developer | michaelbourne |
Plugin | Custom Icons for Elementor |
Version | 0.2.4 |
Comparing to | |
See all releases |
Code changes from version 0.2.3 to 0.2.4
- README.txt +10 -1
- assets/css/elementor-custom-icons.css +6 -19
- elementor-custom-icons.php +23 -14
- includes/merge.css.php +3 -2
- includes/save.font.php +14 -6
- includes/template.options.page.php +1 -1
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: 5.2.1
|
7 |
-
Stable tag: 0.2.
|
8 |
License: GPLv3 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
10 |
|
@@ -63,6 +63,12 @@ None yet
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 0.2.3 =
|
67 |
* Adjusted priority of custom function to prevent certain themes from breaking it
|
68 |
* Change to parse css function to prevent a possible but rare error
|
@@ -103,6 +109,9 @@ None yet
|
|
103 |
|
104 |
== Upgrade Notice ==
|
105 |
|
|
|
|
|
|
|
106 |
= 0.2.3 =
|
107 |
Small fix for themes that were conflicting with custom icons being registered. Slight CSS change.
|
108 |
|
4 |
Tags: elementor, icons, fontello, icon fonts
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.2.1
|
7 |
+
Stable tag: 0.2.4
|
8 |
License: GPLv3 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
10 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 0.2.4 =
|
67 |
+
* Supress PHP warning if Fontello file can't be read by server
|
68 |
+
* Add URL fallback for Fontello file reading (some servers are setup in a way that prevents server path reading)
|
69 |
+
* Fix "empty Fontello file name" issues by defaulting to ZIP file name instead of random string, thereby fixing the "disappearing icons" in unnamed files
|
70 |
+
* Fix CSS issues in editor and icon lists
|
71 |
+
|
72 |
= 0.2.3 =
|
73 |
* Adjusted priority of custom function to prevent certain themes from breaking it
|
74 |
* Change to parse css function to prevent a possible but rare error
|
109 |
|
110 |
== Upgrade Notice ==
|
111 |
|
112 |
+
= 0.2.4 =
|
113 |
+
PHP & CSS fixes
|
114 |
+
|
115 |
= 0.2.3 =
|
116 |
Small fix for themes that were conflicting with custom icons being registered. Slight CSS change.
|
117 |
|
assets/css/elementor-custom-icons.css
CHANGED
@@ -19,7 +19,6 @@
|
|
19 |
text-align: center;
|
20 |
background: white;
|
21 |
-webkit-transition: all 0.5s ease-out;
|
22 |
-
-o-transition: all 0.5s ease-out;
|
23 |
transition: all 0.5s ease-out;
|
24 |
margin: auto;
|
25 |
position: absolute;
|
@@ -37,7 +36,6 @@
|
|
37 |
height: 220px;
|
38 |
color: #8e99a5;
|
39 |
-webkit-transition: all 0.5s ease-out;
|
40 |
-
-o-transition: all 0.5s ease-out;
|
41 |
transition: all 0.5s ease-out;
|
42 |
margin: auto;
|
43 |
position: absolute;
|
@@ -92,7 +90,6 @@
|
|
92 |
left: 50%;
|
93 |
top: 50%;
|
94 |
-webkit-transform: translate(-50%, -50%);
|
95 |
-
-ms-transform: translate(-50%, -50%);
|
96 |
transform: translate(-50%, -50%);
|
97 |
}
|
98 |
|
@@ -108,9 +105,6 @@
|
|
108 |
opacity: 0;
|
109 |
margin-top: 15%;
|
110 |
background-color: #f7f7f7;
|
111 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
|
112 |
-
background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
|
113 |
-
background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
|
114 |
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#f9f9f9));
|
115 |
background-image: linear-gradient(top, #f5f5f5, #f9f9f9);
|
116 |
background-repeat: repeat-x;
|
@@ -128,9 +122,6 @@
|
|
128 |
width: 0;
|
129 |
height: 18px;
|
130 |
background-color: #0e90d2;
|
131 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
|
132 |
-
background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
|
133 |
-
background-image: -o-linear-gradient(top, #149bdf, #0480be);
|
134 |
background-image: -webkit-gradient(linear, left top, left bottom, from(#149bdf), to(#0480be));
|
135 |
background-image: linear-gradient(top, #149bdf, #0480be);
|
136 |
background-repeat: repeat-x;
|
@@ -140,7 +131,6 @@
|
|
140 |
-webkit-box-sizing: border-box;
|
141 |
box-sizing: border-box;
|
142 |
-webkit-transition: width 0.6s ease;
|
143 |
-
-o-transition: width 0.6s ease;
|
144 |
transition: width 0.6s ease;
|
145 |
}
|
146 |
|
@@ -197,8 +187,7 @@
|
|
197 |
font-size: 1.185em;
|
198 |
font-weight: 600;
|
199 |
line-height: 4em;
|
200 |
-
|
201 |
-
text-overflow: ellipsis;
|
202 |
white-space: nowrap;
|
203 |
}
|
204 |
|
@@ -271,7 +260,6 @@ p.eci-extensions-info {
|
|
271 |
padding: calc(5% + 3.375em) 1.5em;
|
272 |
-webkit-transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
273 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
274 |
-
-o-transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
275 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
276 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
277 |
}
|
@@ -281,8 +269,7 @@ p.eci-extensions-info {
|
|
281 |
margin: 1em 0 0;
|
282 |
font-size: 1.25em;
|
283 |
line-height: 1.2;
|
284 |
-
|
285 |
-
text-overflow: ellipsis;
|
286 |
white-space: nowrap;
|
287 |
}
|
288 |
|
@@ -309,7 +296,6 @@ p.eci-extensions-info {
|
|
309 |
background-color: #9e9e9e;
|
310 |
border-radius: 0.45em;
|
311 |
-webkit-transition: border-color 0.3s ease, background-color 0.3s ease;
|
312 |
-
-o-transition: border-color 0.3s ease, background-color 0.3s ease;
|
313 |
transition: border-color 0.3s ease, background-color 0.3s ease;
|
314 |
cursor: pointer;
|
315 |
}
|
@@ -329,16 +315,18 @@ p.eci-extensions-info {
|
|
329 |
color: #2ecc71;
|
330 |
opacity: 0;
|
331 |
-webkit-transform: scale(0.85);
|
332 |
-
-ms-transform: scale(0.85);
|
333 |
transform: scale(0.85);
|
334 |
-webkit-transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
335 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
336 |
-
-o-transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
337 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
338 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
339 |
z-index: 3;
|
340 |
pointer-events: none;
|
341 |
}
|
|
|
|
|
|
|
|
|
342 |
/**
|
343 |
.wrapper-list-fonts .eci-extension-status-icon svg { width: 100%; height: 100%; fill: currentColor }
|
344 |
.wrapper-list-fonts .eci-extension-status-icon { opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1) }
|
@@ -467,7 +455,6 @@ p.eci-extensions-info {
|
|
467 |
-webkit-box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.715);
|
468 |
box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.715);
|
469 |
-webkit-transition: color 0.3s ease;
|
470 |
-
-o-transition: color 0.3s ease;
|
471 |
transition: color 0.3s ease;
|
472 |
cursor: pointer
|
473 |
}
|
19 |
text-align: center;
|
20 |
background: white;
|
21 |
-webkit-transition: all 0.5s ease-out;
|
|
|
22 |
transition: all 0.5s ease-out;
|
23 |
margin: auto;
|
24 |
position: absolute;
|
36 |
height: 220px;
|
37 |
color: #8e99a5;
|
38 |
-webkit-transition: all 0.5s ease-out;
|
|
|
39 |
transition: all 0.5s ease-out;
|
40 |
margin: auto;
|
41 |
position: absolute;
|
90 |
left: 50%;
|
91 |
top: 50%;
|
92 |
-webkit-transform: translate(-50%, -50%);
|
|
|
93 |
transform: translate(-50%, -50%);
|
94 |
}
|
95 |
|
105 |
opacity: 0;
|
106 |
margin-top: 15%;
|
107 |
background-color: #f7f7f7;
|
|
|
|
|
|
|
108 |
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#f9f9f9));
|
109 |
background-image: linear-gradient(top, #f5f5f5, #f9f9f9);
|
110 |
background-repeat: repeat-x;
|
122 |
width: 0;
|
123 |
height: 18px;
|
124 |
background-color: #0e90d2;
|
|
|
|
|
|
|
125 |
background-image: -webkit-gradient(linear, left top, left bottom, from(#149bdf), to(#0480be));
|
126 |
background-image: linear-gradient(top, #149bdf, #0480be);
|
127 |
background-repeat: repeat-x;
|
131 |
-webkit-box-sizing: border-box;
|
132 |
box-sizing: border-box;
|
133 |
-webkit-transition: width 0.6s ease;
|
|
|
134 |
transition: width 0.6s ease;
|
135 |
}
|
136 |
|
187 |
font-size: 1.185em;
|
188 |
font-weight: 600;
|
189 |
line-height: 4em;
|
190 |
+
text-overflow: ellipsis;
|
|
|
191 |
white-space: nowrap;
|
192 |
}
|
193 |
|
260 |
padding: calc(5% + 3.375em) 1.5em;
|
261 |
-webkit-transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
262 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
263 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
264 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
265 |
}
|
269 |
margin: 1em 0 0;
|
270 |
font-size: 1.25em;
|
271 |
line-height: 1.2;
|
272 |
+
text-overflow: ellipsis;
|
|
|
273 |
white-space: nowrap;
|
274 |
}
|
275 |
|
296 |
background-color: #9e9e9e;
|
297 |
border-radius: 0.45em;
|
298 |
-webkit-transition: border-color 0.3s ease, background-color 0.3s ease;
|
|
|
299 |
transition: border-color 0.3s ease, background-color 0.3s ease;
|
300 |
cursor: pointer;
|
301 |
}
|
315 |
color: #2ecc71;
|
316 |
opacity: 0;
|
317 |
-webkit-transform: scale(0.85);
|
|
|
318 |
transform: scale(0.85);
|
319 |
-webkit-transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
320 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
321 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
322 |
transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1), transform 0.65s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
|
323 |
z-index: 3;
|
324 |
pointer-events: none;
|
325 |
}
|
326 |
+
|
327 |
+
.wrapper-list-fonts .iconlist i.eci {
|
328 |
+
display: inline-block;
|
329 |
+
}
|
330 |
/**
|
331 |
.wrapper-list-fonts .eci-extension-status-icon svg { width: 100%; height: 100%; fill: currentColor }
|
332 |
.wrapper-list-fonts .eci-extension-status-icon { opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1) }
|
455 |
-webkit-box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.715);
|
456 |
box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.715);
|
457 |
-webkit-transition: color 0.3s ease;
|
|
|
458 |
transition: color 0.3s ease;
|
459 |
cursor: pointer
|
460 |
}
|
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.2.
|
6 |
Author: Michael Bourne
|
7 |
Author URI: https://michaelbourne.ca
|
8 |
License: GPL3
|
@@ -29,7 +29,7 @@ if( ! defined( 'ABSPATH' ) ) {
|
|
29 |
|
30 |
defined( 'ECIcons_ROOT' ) or define( 'ECIcons_ROOT', dirname( __FILE__ ) );
|
31 |
defined( 'ECIcons_URI' ) or define( 'ECIcons_URI', plugin_dir_url( __FILE__ ) );
|
32 |
-
defined( 'ECIcons_VERSION' ) or define( 'ECIcons_VERSION', '0.2.
|
33 |
defined( 'ECIcons_UPLOAD' ) or define( 'ECIcons_UPLOAD', 'elementor_icons_files' );
|
34 |
|
35 |
class ECIcons {
|
@@ -118,7 +118,7 @@ class ECIcons {
|
|
118 |
//$this->upload_dir_single = str_replace( get_option('siteurl'), '', $this->upload_url );
|
119 |
|
120 |
// set plugin version
|
121 |
-
$this->version = '0.2.
|
122 |
|
123 |
// SSL fix because WordPress core function wp_upload_dir() doesn't check protocol.
|
124 |
if ( is_ssl() ) $this->upload_url = str_replace( 'http://', 'https://', $this->upload_url );
|
@@ -224,7 +224,7 @@ class ECIcons {
|
|
224 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
225 |
'plugin_url' => ECIcons_URI,
|
226 |
'exist' => __( "This font file already exists. Make sure you're giving it a unique name!", 'custom-icons-for-elementor' ),
|
227 |
-
'failedopen' => __( 'Failed to open the ZIP archive. If you uploaded a valid ZIP file, your host may be blocking this PHP function. Please get in touch with them.', 'custom-icons-for-elementor' ),
|
228 |
'failedextract' => __( 'Failed to extract the ZIP archive. Your host may be blocking this PHP function. Please get in touch with them.', 'custom-icons-for-elementor' ),
|
229 |
'emptyfile' => __( 'Your browser failed to upload the file. Please try again.', 'custom-icons-for-elementor' ),
|
230 |
'regen' => __( 'Custom Icon CSS file has been regenerated.', 'custom-icons-for-elementor' ),
|
@@ -303,13 +303,14 @@ class ECIcons {
|
|
303 |
}
|
304 |
|
305 |
if ( empty( $data['name'] ) ) {
|
306 |
-
$
|
|
|
307 |
$data['nameempty'] = true;
|
308 |
$data['css_root'] = $data['css_folder'] . '/fontello.css';
|
309 |
-
$data['css_url'] = $this->upload_url . $css_folder . '/fontello.css';
|
310 |
} else {
|
311 |
$data['css_root'] = $data['css_folder'] . '/' . $data['name'] . '.css';
|
312 |
-
$data['css_url'] = $this->upload_url . $css_folder . '/' . $data['name'] . '.css';
|
313 |
}
|
314 |
|
315 |
|
@@ -349,7 +350,7 @@ class ECIcons {
|
|
349 |
|
350 |
$font_data = json_decode($font['data'],true);
|
351 |
|
352 |
-
$new_icons_reverse = $this->parse_css_reverse( $font_data['css_root'], $font_data['name'] );
|
353 |
if ( !empty($new_icons_reverse) && is_array( $new_icons_reverse ) ) {
|
354 |
$icons = array_merge($new_icons_reverse, $icons);
|
355 |
}
|
@@ -367,9 +368,10 @@ class ECIcons {
|
|
367 |
*
|
368 |
* @param string $css_file
|
369 |
* @param string $name
|
|
|
370 |
* @return array $icons
|
371 |
*/
|
372 |
-
protected function parse_css( $css_file, $name ) {
|
373 |
|
374 |
/**
|
375 |
if ( ! file_exists( $css_file ) ) {
|
@@ -377,9 +379,12 @@ class ECIcons {
|
|
377 |
}
|
378 |
**/
|
379 |
|
380 |
-
$css_source = file_get_contents( $css_file );
|
381 |
|
382 |
-
if ( $css_source === false )
|
|
|
|
|
|
|
383 |
|
384 |
$icons = array();
|
385 |
|
@@ -398,9 +403,10 @@ class ECIcons {
|
|
398 |
*
|
399 |
* @param string $css_file
|
400 |
* @param string $name
|
|
|
401 |
* @return array $icons
|
402 |
*/
|
403 |
-
protected function parse_css_reverse( $css_file, $name ) {
|
404 |
|
405 |
/**
|
406 |
if ( ! file_exists( $css_file ) ) {
|
@@ -408,9 +414,12 @@ class ECIcons {
|
|
408 |
}
|
409 |
**/
|
410 |
|
411 |
-
$css_source = file_get_contents( $css_file );
|
412 |
|
413 |
-
if ( $css_source === false )
|
|
|
|
|
|
|
414 |
|
415 |
$icons = array();
|
416 |
|
2 |
/*
|
3 |
Plugin Name: Custom Icons for Elementor
|
4 |
Description: Add custom icon fonts to the built in Elementor controls
|
5 |
+
Version: 0.2.4
|
6 |
Author: Michael Bourne
|
7 |
Author URI: https://michaelbourne.ca
|
8 |
License: GPL3
|
29 |
|
30 |
defined( 'ECIcons_ROOT' ) or define( 'ECIcons_ROOT', dirname( __FILE__ ) );
|
31 |
defined( 'ECIcons_URI' ) or define( 'ECIcons_URI', plugin_dir_url( __FILE__ ) );
|
32 |
+
defined( 'ECIcons_VERSION' ) or define( 'ECIcons_VERSION', '0.2.4' );
|
33 |
defined( 'ECIcons_UPLOAD' ) or define( 'ECIcons_UPLOAD', 'elementor_icons_files' );
|
34 |
|
35 |
class ECIcons {
|
118 |
//$this->upload_dir_single = str_replace( get_option('siteurl'), '', $this->upload_url );
|
119 |
|
120 |
// set plugin version
|
121 |
+
$this->version = '0.2.4';
|
122 |
|
123 |
// SSL fix because WordPress core function wp_upload_dir() doesn't check protocol.
|
124 |
if ( is_ssl() ) $this->upload_url = str_replace( 'http://', 'https://', $this->upload_url );
|
224 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
225 |
'plugin_url' => ECIcons_URI,
|
226 |
'exist' => __( "This font file already exists. Make sure you're giving it a unique name!", 'custom-icons-for-elementor' ),
|
227 |
+
'failedopen' => __( 'Failed to open the ZIP archive. If you uploaded a valid Fontello ZIP file, your host may be blocking this PHP function. Please get in touch with them.', 'custom-icons-for-elementor' ),
|
228 |
'failedextract' => __( 'Failed to extract the ZIP archive. Your host may be blocking this PHP function. Please get in touch with them.', 'custom-icons-for-elementor' ),
|
229 |
'emptyfile' => __( 'Your browser failed to upload the file. Please try again.', 'custom-icons-for-elementor' ),
|
230 |
'regen' => __( 'Custom Icon CSS file has been regenerated.', 'custom-icons-for-elementor' ),
|
303 |
}
|
304 |
|
305 |
if ( empty( $data['name'] ) ) {
|
306 |
+
$noname = explode('.', $file_name);
|
307 |
+
$data['name'] = $noname[0];
|
308 |
$data['nameempty'] = true;
|
309 |
$data['css_root'] = $data['css_folder'] . '/fontello.css';
|
310 |
+
$data['css_url'] = $this->upload_url . '/' . $css_folder . '/fontello.css';
|
311 |
} else {
|
312 |
$data['css_root'] = $data['css_folder'] . '/' . $data['name'] . '.css';
|
313 |
+
$data['css_url'] = $this->upload_url . '/' . $css_folder . '/' . $data['name'] . '.css';
|
314 |
}
|
315 |
|
316 |
|
350 |
|
351 |
$font_data = json_decode($font['data'],true);
|
352 |
|
353 |
+
$new_icons_reverse = $this->parse_css_reverse( $font_data['css_root'], $font_data['name'], $font_data['css_url'] );
|
354 |
if ( !empty($new_icons_reverse) && is_array( $new_icons_reverse ) ) {
|
355 |
$icons = array_merge($new_icons_reverse, $icons);
|
356 |
}
|
368 |
*
|
369 |
* @param string $css_file
|
370 |
* @param string $name
|
371 |
+
* @param string $url
|
372 |
* @return array $icons
|
373 |
*/
|
374 |
+
protected function parse_css( $css_file, $name, $url ) {
|
375 |
|
376 |
/**
|
377 |
if ( ! file_exists( $css_file ) ) {
|
379 |
}
|
380 |
**/
|
381 |
|
382 |
+
$css_source = @file_get_contents( $css_file );
|
383 |
|
384 |
+
if ( $css_source === false ) {
|
385 |
+
$css_source = @file_get_contents( $url );
|
386 |
+
if ( $css_source === false ) return null;
|
387 |
+
}
|
388 |
|
389 |
$icons = array();
|
390 |
|
403 |
*
|
404 |
* @param string $css_file
|
405 |
* @param string $name
|
406 |
+
* @param string $url
|
407 |
* @return array $icons
|
408 |
*/
|
409 |
+
protected function parse_css_reverse( $css_file, $name, $url ) {
|
410 |
|
411 |
/**
|
412 |
if ( ! file_exists( $css_file ) ) {
|
414 |
}
|
415 |
**/
|
416 |
|
417 |
+
$css_source = @file_get_contents( $css_file );
|
418 |
|
419 |
+
if ( $css_source === false ) {
|
420 |
+
$css_source = @file_get_contents( $url );
|
421 |
+
if ( $css_source === false ) return null;
|
422 |
+
}
|
423 |
|
424 |
$icons = array();
|
425 |
|
includes/merge.css.php
CHANGED
@@ -35,7 +35,8 @@ class MergeCss_ECIcons extends ECIcons {
|
|
35 |
-webkit-font-smoothing: antialiased;
|
36 |
-moz-osx-font-smoothing: grayscale;
|
37 |
}
|
38 |
-
.
|
|
|
39 |
display: inline-block;
|
40 |
}\n";
|
41 |
if ( !empty( $options ) && is_array($options) ) {
|
@@ -70,7 +71,7 @@ class MergeCss_ECIcons extends ECIcons {
|
|
70 |
font-style: normal;
|
71 |
}\n";
|
72 |
|
73 |
-
$icons = ec_icons_manager()->parse_css( $font_data['css_root'], $font_data['name'] );
|
74 |
|
75 |
if (!empty($icons) && is_array($icons)){
|
76 |
|
35 |
-webkit-font-smoothing: antialiased;
|
36 |
-moz-osx-font-smoothing: grayscale;
|
37 |
}
|
38 |
+
.select2-container i.eci,
|
39 |
+
.elementor-icon-list-icon i.eci {
|
40 |
display: inline-block;
|
41 |
}\n";
|
42 |
if ( !empty( $options ) && is_array($options) ) {
|
71 |
font-style: normal;
|
72 |
}\n";
|
73 |
|
74 |
+
$icons = ec_icons_manager()->parse_css( $font_data['css_root'], $font_data['name'], $font_data['css_url'] );
|
75 |
|
76 |
if (!empty($icons) && is_array($icons)){
|
77 |
|
includes/save.font.php
CHANGED
@@ -34,6 +34,12 @@ class SaveFont_ECIcons extends ECIcons {
|
|
34 |
|
35 |
if ( wp_verify_nonce( $this->getRequest( '_wpnonce' ), 'ec_icons_nonce' ) ) {
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$file_name = $this->getRequest( 'file_name', 'font' );
|
38 |
|
39 |
$result = array();
|
@@ -58,7 +64,7 @@ class SaveFont_ECIcons extends ECIcons {
|
|
58 |
|
59 |
$font_data = $this->get_config_font( $file_name );
|
60 |
|
61 |
-
$icons = $this->parse_css( $font_data['css_root'], $font_data['name'] );
|
62 |
|
63 |
if ( ! empty( $icons ) && is_array( $icons ) ) {
|
64 |
$result['count_icons'] = count( $icons );
|
@@ -69,13 +75,15 @@ class SaveFont_ECIcons extends ECIcons {
|
|
69 |
$iconlist .= '<div><i class="eci ' . $iconkey . '" style="font-size: 16px;"></i><span>' . $iconkey . '</span></div>';
|
70 |
}
|
71 |
$result['iconlist'] = $iconlist;
|
72 |
-
}
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
|
|
|
|
|
|
|
79 |
|
80 |
} else {
|
81 |
$result['status_save'] = 'emptyfile';
|
34 |
|
35 |
if ( wp_verify_nonce( $this->getRequest( '_wpnonce' ), 'ec_icons_nonce' ) ) {
|
36 |
|
37 |
+
if ( !class_exists('ZipArchive') ) {
|
38 |
+
$result['status_save'] = 'failedopen';
|
39 |
+
echo json_encode( $result );
|
40 |
+
die();
|
41 |
+
}
|
42 |
+
|
43 |
$file_name = $this->getRequest( 'file_name', 'font' );
|
44 |
|
45 |
$result = array();
|
64 |
|
65 |
$font_data = $this->get_config_font( $file_name );
|
66 |
|
67 |
+
$icons = $this->parse_css( $font_data['css_root'], $font_data['name'], $font_data['css_url'] );
|
68 |
|
69 |
if ( ! empty( $icons ) && is_array( $icons ) ) {
|
70 |
$result['count_icons'] = count( $icons );
|
75 |
$iconlist .= '<div><i class="eci ' . $iconkey . '" style="font-size: 16px;"></i><span>' . $iconkey . '</span></div>';
|
76 |
}
|
77 |
$result['iconlist'] = $iconlist;
|
|
|
78 |
|
79 |
+
$result['name'] = $font_data['name'];
|
80 |
+
$result['status_save'] = $this->update_options( $font_data, '1');
|
81 |
+
$result['data'] = $font_data;
|
82 |
|
83 |
+
new MergeCss_ECIcons();
|
84 |
+
} else {
|
85 |
+
$result['status_save'] = 'emptyfile';
|
86 |
+
}
|
87 |
|
88 |
} else {
|
89 |
$result['status_save'] = 'emptyfile';
|
includes/template.options.page.php
CHANGED
@@ -182,7 +182,7 @@ $options = get_option( 'ec_icons_fonts' );
|
|
182 |
}
|
183 |
|
184 |
$font_data = json_decode( $font['data'], true );
|
185 |
-
$icons = ec_icons_manager()->parse_css( $font_data['css_root'], $key );
|
186 |
$first_icon = ! empty( $icons ) ? key( $icons ) : '';
|
187 |
|
188 |
?>
|
182 |
}
|
183 |
|
184 |
$font_data = json_decode( $font['data'], true );
|
185 |
+
$icons = ec_icons_manager()->parse_css( $font_data['css_root'], $key, $font_data['css_url'] );
|
186 |
$first_icon = ! empty( $icons ) ? key( $icons ) : '';
|
187 |
|
188 |
?>
|