Version Description
- March 10th, 2015 =
- Fixed issue with icons not being selectable.
- Adjusted the limit check for the custom icons.
Download this release
Release Info
Developer | eherman24 |
Plugin | WP SVG Icons |
Version | 3.1.8.4 |
Comparing to | |
See all releases |
Code changes from version 3.1.8.3 to 3.1.8.4
- admin/partials/wp-svg-icons-custom-icons-page.php +133 -134
- readme.txt +21 -13
- wp-svg-icons.php +5 -5
admin/partials/wp-svg-icons-custom-icons-page.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
if( file_exists( '../../../../../wp-load.php' ) ) {
|
3 |
// required for _e() to work inside of the modal
|
4 |
-
include_once( "../../../../../wp-load.php" );
|
5 |
}
|
6 |
?>
|
7 |
|
8 |
<div class="svg-custom-upload-wrap wrap" style="min-width:900px;">
|
9 |
-
|
10 |
<?php if( !file_exists( '../../../../../wp-load.php' ) ) { ?>
|
11 |
<!-- review us container -->
|
12 |
<div id="review-wp-svg-icons" style="position:absolute;right:15em;top:0;margin:0 3em 0 0;text-align:center;">
|
@@ -22,14 +22,14 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
22 |
<a href="https://www.evan-herman.com/feed/"><img src="<?php echo plugin_dir_url( __FILE__ ); ?>/../../images/rss_icon.png"></a><br />
|
23 |
</div>
|
24 |
<?php } ?>
|
25 |
-
|
26 |
<!-- get uploaded file, unzip .zip, store files in appropriate locations, populate page with custom icons -->
|
27 |
<!-- wp_handle_upload ( http://codex.wordpress.org/Function_Reference/wp_handle_upload ) -->
|
28 |
-
<?php
|
29 |
-
|
30 |
if ( isset( $_FILES['custom_icon_pack'] ) ) {
|
31 |
-
|
32 |
-
/*
|
33 |
Validate our nonce for security reasons
|
34 |
@since 3.1.8.2
|
35 |
*/
|
@@ -40,10 +40,10 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
40 |
}
|
41 |
}
|
42 |
|
43 |
-
|
44 |
$uploadedfile = $_FILES['custom_icon_pack'];
|
45 |
$upload_overrides = array( 'test_form' => false );
|
46 |
-
|
47 |
$filename = $uploadedfile['name'];
|
48 |
$break = explode('.', $filename);
|
49 |
$count = count( $break );
|
@@ -65,35 +65,35 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
65 |
<?php
|
66 |
exit();
|
67 |
}
|
68 |
-
|
69 |
// move the file to the custom upload path set above on line 63
|
70 |
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
|
71 |
if( is_wp_error( $movefile ) ) {
|
72 |
$error_string = $movefile->get_error_message();
|
73 |
wp_die( '<div id="message" class="error"><p>' . $error_string . '</p></div>' );
|
74 |
}
|
75 |
-
|
76 |
// if upload was successful
|
77 |
-
if ( $movefile ) {
|
78 |
-
|
79 |
echo '<script>
|
80 |
-
jQuery(document).ready(function() {
|
81 |
-
jQuery(".preview-icon-code-box").show();
|
82 |
-
jQuery(".wp-svg-custom-pack-preloader").show();
|
83 |
-
jQuery("#uninstall-pack-button").removeAttr("disabled");
|
84 |
-
jQuery("#wp_svg_custom_pack_field").attr("disabled","disabled");
|
85 |
-
jQuery("input[value=Import]").attr("disabled","disabled");
|
86 |
-
jQuery(".svg-custom-pack-buttons").after("<div class=updated><p class=fontPackUploadedSuccess>' . __( "Custom font pack successfully uploaded!" , "wp-svg-icons" ) . '</p></div>");
|
87 |
});
|
88 |
-
</script>';
|
89 |
-
|
90 |
// unzip the file contents to the same directory
|
91 |
WP_Filesystem();
|
92 |
-
|
93 |
$dest = wp_upload_dir();
|
94 |
$dest_path = $dest['path'];
|
95 |
$fileNameNoSpaces = str_replace(' ', '-',$uploadedfile['name']);
|
96 |
-
|
97 |
$unzipfile = unzip_file( $dest_path.'/'.$fileNameNoSpaces, $dest_path );
|
98 |
if( is_wp_error( $unzipfile ) ) {
|
99 |
?>
|
@@ -109,12 +109,12 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
109 |
}
|
110 |
wp_die( '<div id="message" class="error"><p>' . $error_string . '</p></div>' );
|
111 |
}
|
112 |
-
|
113 |
if ( $unzipfile ) {
|
114 |
-
|
115 |
// check for the json file
|
116 |
// to ensure we've got a icomoon .zip
|
117 |
-
if( !file_exists( $dest_path.'/'.'selection.json' ) ) {
|
118 |
echo $dest_path.'/'.'selection.json';
|
119 |
?>
|
120 |
<style>
|
@@ -132,104 +132,105 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
132 |
wp_svg_icons_delete_entire_directory( $dest_path );
|
133 |
exit();
|
134 |
}
|
135 |
-
|
136 |
-
|
137 |
// rename the initial .zip file
|
138 |
$test_rename_zip = rename($dest_path.'/'.$fileNameNoSpaces,$dest_path.'/'.'wp-svg-custom-pack.zip');
|
139 |
// rename the json file that comes with icomoon files
|
140 |
$test_rename_json = rename($dest_path.'/'.'selection.json',$dest_path.'/'.'wp-svg-custom-pack.json');
|
141 |
-
|
142 |
$file = $dest_path.'/demo.html';
|
143 |
-
|
144 |
// Open the file to get existing content
|
145 |
$current = file_get_contents($file);
|
146 |
-
|
147 |
// remove the link tags
|
148 |
// for css and js files that are not needed any more
|
149 |
$current = str_replace('<link rel="stylesheet" href="demo-files/demo.css">','',$current);
|
150 |
$current = str_replace('<link rel="stylesheet" href="style.css"></head>','',$current);
|
151 |
$current = str_replace('<script src="demo-files/demo.js"></script>','',$current);
|
152 |
$current = str_replace( 'icon-' , 'wp-svg-custom-' , $current );
|
153 |
-
|
154 |
// Write the contents back to the file
|
155 |
$file_put_contents = file_put_contents($file, $current);
|
156 |
-
|
157 |
// change path of linked font files in style.css
|
158 |
$styleCSS = $dest_path.'/style.css';
|
159 |
$currentStyles = file_get_contents($styleCSS);
|
160 |
-
|
161 |
// remove the link tags
|
162 |
// for css and js files that are not needed any more
|
163 |
$newStyles = str_replace( "url('fonts/" , "url( '" . site_url() . "/wp-content/uploads/wp-svg-icons/custom-pack/fonts/" , $currentStyles );
|
164 |
$newStyles = str_replace( 'icon-' , 'wp-svg-custom-' , $newStyles );
|
165 |
-
|
166 |
// Write the contents back to the file
|
167 |
$file_put_contents = file_put_contents($styleCSS, $newStyles);
|
168 |
-
|
169 |
// delete unecessary files
|
170 |
if ( file_exists( $dest_path . '/demo-files' ) ) {
|
171 |
$admin_class = new WP_SVG_Icons_Admin( 'wp-svg-icons' , '1.0' );
|
172 |
$admin_class->recursive_delete_directory($dest_path.'/demo-files');
|
173 |
}
|
174 |
-
|
175 |
// delete the readme file
|
176 |
if ( file_exists( $dest_path . '/Read Me.txt' ) ) {
|
177 |
-
unlink($dest_path.'/Read Me.txt');
|
178 |
}
|
179 |
-
|
180 |
// display success message
|
181 |
// disable file upload field
|
182 |
-
echo '<script>jQuery(document).ready(function() { jQuery(".dropDownButton").removeAttr("disabled"); jQuery(".fontPackUploadedSuccess").parent("div").after("<div class=updated><p class=fontPackSuccessUnzip>' . __( "Custom font pack successfully unzipped!" , "wp-svg-icons" ) . '</p></div>"); });</script>';
|
183 |
-
|
184 |
echo '<script>jQuery(document).ready(function() { jQuery(".fontPackSuccessUnzip").parent("div").after("<div class=updated><p>' . __( "Custom font pack successfully installed, enjoy!" , "wp-svg-icons" ) . '</p></div>"); setTimeout(function() { jQuery(".updated").fadeOut(); }, 5000); });</script>';
|
185 |
-
|
186 |
// ajax get demo.html file
|
187 |
-
// ajax get style.css file and append to head to show icons
|
188 |
echo '<script>
|
189 |
-
jQuery(document).ready(function() {
|
190 |
-
jQuery(".current-font-pack").load("'.site_url().'/wp-content/uploads/wp-svg-icons/custom-pack/demo.html");
|
191 |
-
jQuery.get("'.site_url().'/wp-content/uploads/wp-svg-icons/custom-pack/style.css", function( data ) {
|
192 |
-
jQuery("head").append("<style>"+data+"</style>");
|
193 |
-
});
|
194 |
-
});
|
195 |
</script>';
|
196 |
-
|
197 |
-
|
198 |
} else { // error unzipping the file
|
199 |
-
echo '<script>jQuery(document).ready(function() { jQuery(".fontPackUploadedSuccess").parent("div").after("<div class=error><p>' . __( "There was a problem unzipping the file." , "wp-svg-icons" ) . '</p></div>"); });</script>';
|
200 |
}
|
201 |
-
|
202 |
} else { // error importing the file
|
203 |
-
echo '<script>jQuery(document).ready(function() { jQuery(".svg-custom-pack-buttons").after("<div class=error><p class=fontPackUploadedError>' . __( "There was a problem importing the file.", "wp-svg-icons" ) . '</p></div>"); });</script>';
|
204 |
}
|
205 |
-
|
206 |
-
}
|
207 |
?>
|
208 |
-
|
209 |
-
|
210 |
<h1 class="wp-svg-title"><span style="color:#FF8000;">WP SVG Icons</span> | <?php _e( 'Import a Custom Icon Pack' , 'wp-svg-icons' ); ?></h1>
|
211 |
-
|
212 |
<p><?php _e( 'Welcome to the highly requested Custom Font Pack section! Use the importer below to import custom icon packs downloaded from' , 'wp-svg-icons' ); ?> <a href="http://icomoon.io/app/#/select" target="_blank">IcoMoon</a>.</p>
|
213 |
<p><?php _e( 'For a step-by-step tutorial on how to download and install a custom icon pack visit the' , 'wp-svg-icons' ); ?> <a href="https://www.evan-herman.com/wp-svg-icons/#customPackUploader" target="_blank"><?php _e( 'plugin site' , 'wp-svg-icons' ); ?></a>.</p>
|
214 |
<p><span style="font-size:11px; color: #EE3B3B;"><?php _e( 'Note:' , 'wp-svg-icons' ); ?></span> <?php _e( 'Only one icon pack may be active at a time.' , 'wp-svg-icons' ); ?></p>
|
215 |
<p><span style="font-size:11px; color: #EE3B3B;"><?php _e( 'Note:' , 'wp-svg-icons' ); ?></span> <?php _e( 'If you install a new icon pack, and your old icons appear you may need to empty your browsers cache.' , 'wp-svg-icons' ); ?></p>
|
216 |
-
|
217 |
-
<div class="preview-icon-code-box" style="display:none;float:right;width:350px;">
|
218 |
-
<p style="position: absolute;margin-top: 4.25em;color: #EE3B3B;"><?php _e( 'Shortcode:' , 'wp-svg-icons' ); ?></p>
|
219 |
<div class="wp-svg-icon-preview-box" style="float:right;margin-right:0px;">
|
220 |
<i style="font-size:14px;" class="copy-paste-text"><?php _e( 'Icon Preview:' , 'wp-svg-icons' ); ?></i>
|
221 |
</div>
|
222 |
<input class="copy_paste_input" style="padding-left:0;width:350px;float:left;border-radius:3px;border:1px solid rgba(255, 128, 0, 0.51);box-shadowinset 0 1px 2px rgba(0,0,0,.07);" readonly="" type="text" value='[wp-svg-icons icon="" wrap=""]'>
|
223 |
</div>
|
224 |
-
|
225 |
-
<script>
|
226 |
var run_interval = null;
|
227 |
-
|
228 |
jQuery(document).ready(function() {
|
229 |
-
|
230 |
// check if the pack has loaded
|
231 |
run_interval = setInterval(function() {
|
232 |
-
|
|
|
233 |
return;
|
234 |
// re-run the interval
|
235 |
} else {
|
@@ -249,60 +250,58 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
249 |
jQuery('.downloadFontZipLink').text('Download '+customPackFontName+'.zip');
|
250 |
jQuery('.downloadFontjSonLink').parent('li').find('img').remove();
|
251 |
jQuery('.downloadFontjSonLink').text('Download '+customPackFontName+'.json');
|
252 |
-
|
253 |
-
|
254 |
-
jQuery('.glyph').click(function() {
|
255 |
-
|
256 |
-
jQuery('.glyph').removeClass("selected");
|
257 |
-
jQuery(this).addClass("selected");
|
258 |
-
jQuery('html, body').animate({ scrollTop: 0 }, 'slow');
|
259 |
-
|
260 |
-
var glyphCode = jQuery(this).find('.mls').text();
|
261 |
-
var glyphCode = jQuery.trim(glyphCode);
|
262 |
-
|
263 |
-
//console.log(glyphCode);
|
264 |
-
jQuery('.wp-svg-icon-preview').remove();
|
265 |
-
jQuery('.wp-svg-icon-preview-box > i').after("<b class='wp-svg-icon-preview'><div class='"+glyphCode+" previewIcon' style='display:none;'></div></b>");
|
266 |
-
jQuery('.previewIcon').fadeIn();
|
267 |
-
|
268 |
-
<?php if( get_current_screen()->base != 'wp-svg-icons_page_wp-svg-icons-custom-set' ) { ?>
|
269 |
-
var iconClass = jQuery( '.custom-pack-container-ajax' ).find( '.glyph.selected' ).find( 'span:first-child' ).attr( 'class' );
|
270 |
-
var selectedIconWrapper = jQuery( '.selected-element-wrap' ).attr( 'alt' );
|
271 |
-
<?php } else { ?>
|
272 |
-
var iconClass = jQuery( '.current-font-pack' ).find( '.glyph.selected' ).find( 'span:first-child' ).attr( 'class' );
|
273 |
-
iconClass = iconClass.replace( 'wp-svg-custom-' , '' );
|
274 |
-
var selectedIconWrapper = '<?php echo get_option( 'wp_svg_icons_defualt_icon_container' , 'i' ); ?>';
|
275 |
-
<?php } ?>
|
276 |
-
jQuery('.copy_paste_input').val('[wp-svg-icons custom_icon="'+iconClass.trim()+'" wrap="'+selectedIconWrapper+'"]');
|
277 |
-
|
278 |
-
});
|
279 |
-
|
280 |
}
|
281 |
-
|
282 |
clearInterval(run_interval);
|
283 |
// kill off the interval, once we've got it
|
284 |
-
|
285 |
}, 50);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
});
|
287 |
</script>
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
<style>
|
292 |
.dropdown-menu img {
|
293 |
display:block;
|
294 |
width:15px;
|
295 |
margin:0 auto;
|
296 |
}
|
297 |
-
.ptl { min-width:540px; }
|
298 |
#wpbody-content { min-width:900px; }
|
299 |
-
|
300 |
-
|
301 |
.dropdown-menu .downloadFontZipLink { padding-left:24px !important; background-image: url("<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/zip-icon-small.png");background-repeat:no-repeat; background-size:13px 16px; background-position:6px 4px; }
|
302 |
.dropdown-menu .downloadFontjSonLink { padding-left:24px !important; background-image: url("<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/json-icon-small.png");background-repeat:no-repeat; background-size:13px 16px; background-position:6px 4px; }
|
303 |
#uninstall-pack-button { background-image: url("<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/trash-icon-small.png") !important;background-repeat:no-repeat !important; background-size:13px 14px !important; background-position:6px 6px !important; }
|
304 |
</style>
|
305 |
-
|
306 |
<!-- file upload input field -->
|
307 |
<!-- Handling Custom Font Pack Uploads -->
|
308 |
<!-- currently uploads to Uploads > WP SVG Icons > Custom Pack -->
|
@@ -313,15 +312,15 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
313 |
?>
|
314 |
<p id="async-upload-wrap" style="margin-bottom:0;">
|
315 |
<label for="async-upload"><?php _e( 'Import a Custom Font Pack' , 'wp-svg-icons' ); ?> :</label><br />
|
316 |
-
<input type="file" id="wp_svg_custom_pack_field" name="custom_icon_pack" required="required">
|
317 |
-
<p style="margin:0;">
|
318 |
<span class="custom-icons-file-upload-note"><?php _e( 'note: file must be a .zip downloaded from icomoon' , 'wp-svg-icons' ); ?><span>
|
319 |
-
</p>
|
320 |
<span class="svg-custom-pack-buttons">
|
321 |
<p>
|
322 |
<?php
|
323 |
// print form submission button
|
324 |
-
echo submit_button( 'Import', 'primary', '', false, '' );
|
325 |
?>
|
326 |
</p>
|
327 |
<p style="margin-left:1em;">
|
@@ -332,12 +331,12 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
332 |
$dest_url = $dest['url'];
|
333 |
$dest_path = $dest['path'];
|
334 |
?>
|
335 |
-
</p>
|
336 |
-
|
337 |
<p style="margin-left:1em;">
|
338 |
<a style="height:28px; background-image: url('<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/download-icon-small.png') !important;background-repeat:no-repeat !important; background-size:13px 14px !important;background-position:6px 6px !important" href="#" onclick="return false;" data-dropdown="#dropdown-1" class="dropDownButton button-secondary" disabled="disabled"><?php _e( 'Download' , 'wp-svg-icons' ); ?></a>
|
339 |
</p>
|
340 |
-
|
341 |
<?php if ( file_exists( $dest_path.'/wp-svg-custom-pack.zip' ) ) { ?>
|
342 |
<!-- jquery download dropdown menu -->
|
343 |
<div id="dropdown-1" style="left:210px !important; top:290.8125px !important;" class="dropdown dropdown-anchor-left dropdown-tip">
|
@@ -354,54 +353,54 @@ if( file_exists( '../../../../../wp-load.php' ) ) {
|
|
354 |
</ul>
|
355 |
</div>
|
356 |
<?php } ?>
|
357 |
-
|
358 |
</span>
|
359 |
<!-- display success or error message after font pack deletion -->
|
360 |
<p id="delete_succes_and_error_message"></p>
|
361 |
<p id="unzip_succes_and_error_message"></p>
|
362 |
</p>
|
363 |
</form>
|
364 |
-
|
365 |
<section class="ten-icon-limit-reached" style="display:none;margin:2em 0;text-align:center;font-size:15px;color:rgb(238, 110, 81);padding:10px;">
|
366 |
<span class="dashicons dashicons-welcome-comments"></span> <?php _e( "It looks like you're trying to install and use more than 10 icons. Unfortunately the free version limits the number of custom icons to 10. If you'd like to access more than 10 custom icons, please consider upgrading to the", 'wp-svg-icons' ); ?> <a href="https://www.evan-herman.com/wp-svg-icons-pro/" target="_blank" title="<?php _e( 'Upgrade to pro' , 'wp-svg-icons' ); ?>"><?php _e( 'Pro Version' , 'wp-svg-icons' ); ?></a>
|
367 |
</section>
|
368 |
-
|
369 |
<div class="current-font-pack">
|
370 |
<!-- scandir, or some other php function to loop through the upload directory to check if any files exist -->
|
371 |
<!-- if files exist, list the files meta data. if user uploads new files, warn them the will overwrite active fonts, delete old font files, move new font files, ajax load font-file html files -->
|
372 |
<img style="display:none;" class="wp-svg-custom-pack-preloader" src="<?php echo site_url().'/wp-admin/images/wpspin_light.gif'?>" alt="preloader">
|
373 |
</div>
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
<!-- plugin footer -->
|
378 |
<?php
|
379 |
if ( file_exists( $dest_path.'/wp-svg-custom-pack.zip' ) ) {
|
380 |
-
$fontPackLocationString = __( 'Your Custom Icon Pack is located in' , 'wp-svg-icons' ) . ' : ';
|
381 |
} else {
|
382 |
$fontPackLocationString = __( 'Your Custom Icon Pack will be installed to' , 'wp-svg-icons' ) . ' : ';
|
383 |
}
|
384 |
?>
|
385 |
-
|
386 |
<footer style="padding-left:0;margin-left:0; width: 100%;">
|
387 |
<p style="float:left;"><?php _e( 'Plugin Created By' , 'wp-svg-icons' ); ?> <a style="color:#B35047;" href="https://www.evan-herman.com" target="_blank">Evan Herman</a></p><p style="float:right;"><?php echo $fontPackLocationString.'<b>'.$dest_path.'</b>'; ?></p>
|
388 |
</footer>
|
389 |
</div>
|
390 |
<?php
|
391 |
|
392 |
-
/*
|
393 |
-
Function To Recursively Delete an entire directory
|
394 |
used on fail upload/rename
|
395 |
*/
|
396 |
-
function wp_svg_icons_delete_entire_directory( $dir ) {
|
397 |
-
if ( is_dir( $dir ) ) {
|
398 |
-
$objects = scandir( $dir );
|
399 |
-
foreach ($objects as $object ) {
|
400 |
-
if ( $object != "." && $object != ".." ) {
|
401 |
-
if ( filetype( $dir."/".$object) == "dir" ) wp_svg_icons_delete_entire_directory( $dir."/".$object); else unlink( $dir."/".$object );
|
402 |
-
}
|
403 |
-
}
|
404 |
-
reset( $objects );
|
405 |
-
rmdir( $dir );
|
406 |
-
}
|
407 |
-
}
|
1 |
<?php
|
2 |
if( file_exists( '../../../../../wp-load.php' ) ) {
|
3 |
// required for _e() to work inside of the modal
|
4 |
+
include_once( "../../../../../wp-load.php" );
|
5 |
}
|
6 |
?>
|
7 |
|
8 |
<div class="svg-custom-upload-wrap wrap" style="min-width:900px;">
|
9 |
+
|
10 |
<?php if( !file_exists( '../../../../../wp-load.php' ) ) { ?>
|
11 |
<!-- review us container -->
|
12 |
<div id="review-wp-svg-icons" style="position:absolute;right:15em;top:0;margin:0 3em 0 0;text-align:center;">
|
22 |
<a href="https://www.evan-herman.com/feed/"><img src="<?php echo plugin_dir_url( __FILE__ ); ?>/../../images/rss_icon.png"></a><br />
|
23 |
</div>
|
24 |
<?php } ?>
|
25 |
+
|
26 |
<!-- get uploaded file, unzip .zip, store files in appropriate locations, populate page with custom icons -->
|
27 |
<!-- wp_handle_upload ( http://codex.wordpress.org/Function_Reference/wp_handle_upload ) -->
|
28 |
+
<?php
|
29 |
+
|
30 |
if ( isset( $_FILES['custom_icon_pack'] ) ) {
|
31 |
+
|
32 |
+
/*
|
33 |
Validate our nonce for security reasons
|
34 |
@since 3.1.8.2
|
35 |
*/
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
|
44 |
$uploadedfile = $_FILES['custom_icon_pack'];
|
45 |
$upload_overrides = array( 'test_form' => false );
|
46 |
+
|
47 |
$filename = $uploadedfile['name'];
|
48 |
$break = explode('.', $filename);
|
49 |
$count = count( $break );
|
65 |
<?php
|
66 |
exit();
|
67 |
}
|
68 |
+
|
69 |
// move the file to the custom upload path set above on line 63
|
70 |
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
|
71 |
if( is_wp_error( $movefile ) ) {
|
72 |
$error_string = $movefile->get_error_message();
|
73 |
wp_die( '<div id="message" class="error"><p>' . $error_string . '</p></div>' );
|
74 |
}
|
75 |
+
|
76 |
// if upload was successful
|
77 |
+
if ( $movefile ) {
|
78 |
+
|
79 |
echo '<script>
|
80 |
+
jQuery(document).ready(function() {
|
81 |
+
jQuery(".preview-icon-code-box").show();
|
82 |
+
jQuery(".wp-svg-custom-pack-preloader").show();
|
83 |
+
jQuery("#uninstall-pack-button").removeAttr("disabled");
|
84 |
+
jQuery("#wp_svg_custom_pack_field").attr("disabled","disabled");
|
85 |
+
jQuery("input[value=Import]").attr("disabled","disabled");
|
86 |
+
jQuery(".svg-custom-pack-buttons").after("<div class=updated><p class=fontPackUploadedSuccess>' . __( "Custom font pack successfully uploaded!" , "wp-svg-icons" ) . '</p></div>");
|
87 |
});
|
88 |
+
</script>';
|
89 |
+
|
90 |
// unzip the file contents to the same directory
|
91 |
WP_Filesystem();
|
92 |
+
|
93 |
$dest = wp_upload_dir();
|
94 |
$dest_path = $dest['path'];
|
95 |
$fileNameNoSpaces = str_replace(' ', '-',$uploadedfile['name']);
|
96 |
+
|
97 |
$unzipfile = unzip_file( $dest_path.'/'.$fileNameNoSpaces, $dest_path );
|
98 |
if( is_wp_error( $unzipfile ) ) {
|
99 |
?>
|
109 |
}
|
110 |
wp_die( '<div id="message" class="error"><p>' . $error_string . '</p></div>' );
|
111 |
}
|
112 |
+
|
113 |
if ( $unzipfile ) {
|
114 |
+
|
115 |
// check for the json file
|
116 |
// to ensure we've got a icomoon .zip
|
117 |
+
if( !file_exists( $dest_path.'/'.'selection.json' ) ) {
|
118 |
echo $dest_path.'/'.'selection.json';
|
119 |
?>
|
120 |
<style>
|
132 |
wp_svg_icons_delete_entire_directory( $dest_path );
|
133 |
exit();
|
134 |
}
|
135 |
+
|
136 |
+
|
137 |
// rename the initial .zip file
|
138 |
$test_rename_zip = rename($dest_path.'/'.$fileNameNoSpaces,$dest_path.'/'.'wp-svg-custom-pack.zip');
|
139 |
// rename the json file that comes with icomoon files
|
140 |
$test_rename_json = rename($dest_path.'/'.'selection.json',$dest_path.'/'.'wp-svg-custom-pack.json');
|
141 |
+
|
142 |
$file = $dest_path.'/demo.html';
|
143 |
+
|
144 |
// Open the file to get existing content
|
145 |
$current = file_get_contents($file);
|
146 |
+
|
147 |
// remove the link tags
|
148 |
// for css and js files that are not needed any more
|
149 |
$current = str_replace('<link rel="stylesheet" href="demo-files/demo.css">','',$current);
|
150 |
$current = str_replace('<link rel="stylesheet" href="style.css"></head>','',$current);
|
151 |
$current = str_replace('<script src="demo-files/demo.js"></script>','',$current);
|
152 |
$current = str_replace( 'icon-' , 'wp-svg-custom-' , $current );
|
153 |
+
|
154 |
// Write the contents back to the file
|
155 |
$file_put_contents = file_put_contents($file, $current);
|
156 |
+
|
157 |
// change path of linked font files in style.css
|
158 |
$styleCSS = $dest_path.'/style.css';
|
159 |
$currentStyles = file_get_contents($styleCSS);
|
160 |
+
|
161 |
// remove the link tags
|
162 |
// for css and js files that are not needed any more
|
163 |
$newStyles = str_replace( "url('fonts/" , "url( '" . site_url() . "/wp-content/uploads/wp-svg-icons/custom-pack/fonts/" , $currentStyles );
|
164 |
$newStyles = str_replace( 'icon-' , 'wp-svg-custom-' , $newStyles );
|
165 |
+
|
166 |
// Write the contents back to the file
|
167 |
$file_put_contents = file_put_contents($styleCSS, $newStyles);
|
168 |
+
|
169 |
// delete unecessary files
|
170 |
if ( file_exists( $dest_path . '/demo-files' ) ) {
|
171 |
$admin_class = new WP_SVG_Icons_Admin( 'wp-svg-icons' , '1.0' );
|
172 |
$admin_class->recursive_delete_directory($dest_path.'/demo-files');
|
173 |
}
|
174 |
+
|
175 |
// delete the readme file
|
176 |
if ( file_exists( $dest_path . '/Read Me.txt' ) ) {
|
177 |
+
unlink($dest_path.'/Read Me.txt');
|
178 |
}
|
179 |
+
|
180 |
// display success message
|
181 |
// disable file upload field
|
182 |
+
echo '<script>jQuery(document).ready(function() { jQuery(".dropDownButton").removeAttr("disabled"); jQuery(".fontPackUploadedSuccess").parent("div").after("<div class=updated><p class=fontPackSuccessUnzip>' . __( "Custom font pack successfully unzipped!" , "wp-svg-icons" ) . '</p></div>"); });</script>';
|
183 |
+
|
184 |
echo '<script>jQuery(document).ready(function() { jQuery(".fontPackSuccessUnzip").parent("div").after("<div class=updated><p>' . __( "Custom font pack successfully installed, enjoy!" , "wp-svg-icons" ) . '</p></div>"); setTimeout(function() { jQuery(".updated").fadeOut(); }, 5000); });</script>';
|
185 |
+
|
186 |
// ajax get demo.html file
|
187 |
+
// ajax get style.css file and append to head to show icons
|
188 |
echo '<script>
|
189 |
+
jQuery(document).ready(function() {
|
190 |
+
jQuery(".current-font-pack").load("'.site_url().'/wp-content/uploads/wp-svg-icons/custom-pack/demo.html");
|
191 |
+
jQuery.get("'.site_url().'/wp-content/uploads/wp-svg-icons/custom-pack/style.css", function( data ) {
|
192 |
+
jQuery("head").append("<style>"+data+"</style>");
|
193 |
+
});
|
194 |
+
});
|
195 |
</script>';
|
196 |
+
|
197 |
+
|
198 |
} else { // error unzipping the file
|
199 |
+
echo '<script>jQuery(document).ready(function() { jQuery(".fontPackUploadedSuccess").parent("div").after("<div class=error><p>' . __( "There was a problem unzipping the file." , "wp-svg-icons" ) . '</p></div>"); });</script>';
|
200 |
}
|
201 |
+
|
202 |
} else { // error importing the file
|
203 |
+
echo '<script>jQuery(document).ready(function() { jQuery(".svg-custom-pack-buttons").after("<div class=error><p class=fontPackUploadedError>' . __( "There was a problem importing the file.", "wp-svg-icons" ) . '</p></div>"); });</script>';
|
204 |
}
|
205 |
+
|
206 |
+
}
|
207 |
?>
|
208 |
+
|
209 |
+
|
210 |
<h1 class="wp-svg-title"><span style="color:#FF8000;">WP SVG Icons</span> | <?php _e( 'Import a Custom Icon Pack' , 'wp-svg-icons' ); ?></h1>
|
211 |
+
|
212 |
<p><?php _e( 'Welcome to the highly requested Custom Font Pack section! Use the importer below to import custom icon packs downloaded from' , 'wp-svg-icons' ); ?> <a href="http://icomoon.io/app/#/select" target="_blank">IcoMoon</a>.</p>
|
213 |
<p><?php _e( 'For a step-by-step tutorial on how to download and install a custom icon pack visit the' , 'wp-svg-icons' ); ?> <a href="https://www.evan-herman.com/wp-svg-icons/#customPackUploader" target="_blank"><?php _e( 'plugin site' , 'wp-svg-icons' ); ?></a>.</p>
|
214 |
<p><span style="font-size:11px; color: #EE3B3B;"><?php _e( 'Note:' , 'wp-svg-icons' ); ?></span> <?php _e( 'Only one icon pack may be active at a time.' , 'wp-svg-icons' ); ?></p>
|
215 |
<p><span style="font-size:11px; color: #EE3B3B;"><?php _e( 'Note:' , 'wp-svg-icons' ); ?></span> <?php _e( 'If you install a new icon pack, and your old icons appear you may need to empty your browsers cache.' , 'wp-svg-icons' ); ?></p>
|
216 |
+
|
217 |
+
<div class="preview-icon-code-box" style="display:none;float:right;width:350px;">
|
218 |
+
<p style="position: absolute;margin-top: 4.25em;color: #EE3B3B;"><?php _e( 'Shortcode:' , 'wp-svg-icons' ); ?></p>
|
219 |
<div class="wp-svg-icon-preview-box" style="float:right;margin-right:0px;">
|
220 |
<i style="font-size:14px;" class="copy-paste-text"><?php _e( 'Icon Preview:' , 'wp-svg-icons' ); ?></i>
|
221 |
</div>
|
222 |
<input class="copy_paste_input" style="padding-left:0;width:350px;float:left;border-radius:3px;border:1px solid rgba(255, 128, 0, 0.51);box-shadowinset 0 1px 2px rgba(0,0,0,.07);" readonly="" type="text" value='[wp-svg-icons icon="" wrap=""]'>
|
223 |
</div>
|
224 |
+
|
225 |
+
<script>
|
226 |
var run_interval = null;
|
227 |
+
|
228 |
jQuery(document).ready(function() {
|
229 |
+
|
230 |
// check if the pack has loaded
|
231 |
run_interval = setInterval(function() {
|
232 |
+
console.log( jQuery( '.current-font-pack' ).children().length );
|
233 |
+
if( jQuery( '.glyph' ).length <= 10 ) {
|
234 |
return;
|
235 |
// re-run the interval
|
236 |
} else {
|
250 |
jQuery('.downloadFontZipLink').text('Download '+customPackFontName+'.zip');
|
251 |
jQuery('.downloadFontjSonLink').parent('li').find('img').remove();
|
252 |
jQuery('.downloadFontjSonLink').text('Download '+customPackFontName+'.json');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
}
|
254 |
+
|
255 |
clearInterval(run_interval);
|
256 |
// kill off the interval, once we've got it
|
257 |
+
|
258 |
}, 50);
|
259 |
+
|
260 |
+
jQuery('body').on( 'click', '.glyph', function() {
|
261 |
+
jQuery('.glyph').removeClass("selected");
|
262 |
+
jQuery(this).addClass("selected");
|
263 |
+
jQuery('html, body').animate({ scrollTop: 0 }, 'slow');
|
264 |
+
|
265 |
+
var glyphCode = jQuery(this).find('.mls').text();
|
266 |
+
var glyphCode = jQuery.trim(glyphCode);
|
267 |
+
|
268 |
+
//console.log(glyphCode);
|
269 |
+
jQuery('.wp-svg-icon-preview').remove();
|
270 |
+
jQuery('.wp-svg-icon-preview-box > i').after("<b class='wp-svg-icon-preview'><div class='"+glyphCode+" previewIcon' style='display:none;'></div></b>");
|
271 |
+
jQuery('.previewIcon').fadeIn();
|
272 |
+
|
273 |
+
<?php if( get_current_screen()->base != 'wp-svg-icons_page_wp-svg-icons-custom-set' ) { ?>
|
274 |
+
var iconClass = jQuery( '.custom-pack-container-ajax' ).find( '.glyph.selected' ).find( 'span:first-child' ).attr( 'class' );
|
275 |
+
var selectedIconWrapper = jQuery( '.selected-element-wrap' ).attr( 'alt' );
|
276 |
+
<?php } else { ?>
|
277 |
+
var iconClass = jQuery( '.current-font-pack' ).find( '.glyph.selected' ).find( 'span:first-child' ).attr( 'class' );
|
278 |
+
iconClass = iconClass.replace( 'wp-svg-custom-' , '' );
|
279 |
+
var selectedIconWrapper = '<?php echo get_option( 'wp_svg_icons_defualt_icon_container' , 'i' ); ?>';
|
280 |
+
<?php } ?>
|
281 |
+
jQuery('.copy_paste_input').val('[wp-svg-icons custom_icon="'+iconClass.trim()+'" wrap="'+selectedIconWrapper+'"]');
|
282 |
+
|
283 |
+
});
|
284 |
+
|
285 |
});
|
286 |
</script>
|
287 |
+
|
288 |
+
|
289 |
+
|
290 |
<style>
|
291 |
.dropdown-menu img {
|
292 |
display:block;
|
293 |
width:15px;
|
294 |
margin:0 auto;
|
295 |
}
|
296 |
+
.ptl { min-width:540px; }
|
297 |
#wpbody-content { min-width:900px; }
|
298 |
+
|
299 |
+
|
300 |
.dropdown-menu .downloadFontZipLink { padding-left:24px !important; background-image: url("<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/zip-icon-small.png");background-repeat:no-repeat; background-size:13px 16px; background-position:6px 4px; }
|
301 |
.dropdown-menu .downloadFontjSonLink { padding-left:24px !important; background-image: url("<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/json-icon-small.png");background-repeat:no-repeat; background-size:13px 16px; background-position:6px 4px; }
|
302 |
#uninstall-pack-button { background-image: url("<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/trash-icon-small.png") !important;background-repeat:no-repeat !important; background-size:13px 14px !important; background-position:6px 6px !important; }
|
303 |
</style>
|
304 |
+
|
305 |
<!-- file upload input field -->
|
306 |
<!-- Handling Custom Font Pack Uploads -->
|
307 |
<!-- currently uploads to Uploads > WP SVG Icons > Custom Pack -->
|
312 |
?>
|
313 |
<p id="async-upload-wrap" style="margin-bottom:0;">
|
314 |
<label for="async-upload"><?php _e( 'Import a Custom Font Pack' , 'wp-svg-icons' ); ?> :</label><br />
|
315 |
+
<input type="file" id="wp_svg_custom_pack_field" name="custom_icon_pack" required="required">
|
316 |
+
<p style="margin:0;">
|
317 |
<span class="custom-icons-file-upload-note"><?php _e( 'note: file must be a .zip downloaded from icomoon' , 'wp-svg-icons' ); ?><span>
|
318 |
+
</p>
|
319 |
<span class="svg-custom-pack-buttons">
|
320 |
<p>
|
321 |
<?php
|
322 |
// print form submission button
|
323 |
+
echo submit_button( 'Import', 'primary', '', false, '' );
|
324 |
?>
|
325 |
</p>
|
326 |
<p style="margin-left:1em;">
|
331 |
$dest_url = $dest['url'];
|
332 |
$dest_path = $dest['path'];
|
333 |
?>
|
334 |
+
</p>
|
335 |
+
|
336 |
<p style="margin-left:1em;">
|
337 |
<a style="height:28px; background-image: url('<?php echo site_url();?>/wp-content/plugins/svg-vector-icon-plugin/includes/images/download-icon-small.png') !important;background-repeat:no-repeat !important; background-size:13px 14px !important;background-position:6px 6px !important" href="#" onclick="return false;" data-dropdown="#dropdown-1" class="dropDownButton button-secondary" disabled="disabled"><?php _e( 'Download' , 'wp-svg-icons' ); ?></a>
|
338 |
</p>
|
339 |
+
|
340 |
<?php if ( file_exists( $dest_path.'/wp-svg-custom-pack.zip' ) ) { ?>
|
341 |
<!-- jquery download dropdown menu -->
|
342 |
<div id="dropdown-1" style="left:210px !important; top:290.8125px !important;" class="dropdown dropdown-anchor-left dropdown-tip">
|
353 |
</ul>
|
354 |
</div>
|
355 |
<?php } ?>
|
356 |
+
|
357 |
</span>
|
358 |
<!-- display success or error message after font pack deletion -->
|
359 |
<p id="delete_succes_and_error_message"></p>
|
360 |
<p id="unzip_succes_and_error_message"></p>
|
361 |
</p>
|
362 |
</form>
|
363 |
+
|
364 |
<section class="ten-icon-limit-reached" style="display:none;margin:2em 0;text-align:center;font-size:15px;color:rgb(238, 110, 81);padding:10px;">
|
365 |
<span class="dashicons dashicons-welcome-comments"></span> <?php _e( "It looks like you're trying to install and use more than 10 icons. Unfortunately the free version limits the number of custom icons to 10. If you'd like to access more than 10 custom icons, please consider upgrading to the", 'wp-svg-icons' ); ?> <a href="https://www.evan-herman.com/wp-svg-icons-pro/" target="_blank" title="<?php _e( 'Upgrade to pro' , 'wp-svg-icons' ); ?>"><?php _e( 'Pro Version' , 'wp-svg-icons' ); ?></a>
|
366 |
</section>
|
367 |
+
|
368 |
<div class="current-font-pack">
|
369 |
<!-- scandir, or some other php function to loop through the upload directory to check if any files exist -->
|
370 |
<!-- if files exist, list the files meta data. if user uploads new files, warn them the will overwrite active fonts, delete old font files, move new font files, ajax load font-file html files -->
|
371 |
<img style="display:none;" class="wp-svg-custom-pack-preloader" src="<?php echo site_url().'/wp-admin/images/wpspin_light.gif'?>" alt="preloader">
|
372 |
</div>
|
373 |
+
|
374 |
+
|
375 |
+
|
376 |
<!-- plugin footer -->
|
377 |
<?php
|
378 |
if ( file_exists( $dest_path.'/wp-svg-custom-pack.zip' ) ) {
|
379 |
+
$fontPackLocationString = __( 'Your Custom Icon Pack is located in' , 'wp-svg-icons' ) . ' : ';
|
380 |
} else {
|
381 |
$fontPackLocationString = __( 'Your Custom Icon Pack will be installed to' , 'wp-svg-icons' ) . ' : ';
|
382 |
}
|
383 |
?>
|
384 |
+
|
385 |
<footer style="padding-left:0;margin-left:0; width: 100%;">
|
386 |
<p style="float:left;"><?php _e( 'Plugin Created By' , 'wp-svg-icons' ); ?> <a style="color:#B35047;" href="https://www.evan-herman.com" target="_blank">Evan Herman</a></p><p style="float:right;"><?php echo $fontPackLocationString.'<b>'.$dest_path.'</b>'; ?></p>
|
387 |
</footer>
|
388 |
</div>
|
389 |
<?php
|
390 |
|
391 |
+
/*
|
392 |
+
Function To Recursively Delete an entire directory
|
393 |
used on fail upload/rename
|
394 |
*/
|
395 |
+
function wp_svg_icons_delete_entire_directory( $dir ) {
|
396 |
+
if ( is_dir( $dir ) ) {
|
397 |
+
$objects = scandir( $dir );
|
398 |
+
foreach ($objects as $object ) {
|
399 |
+
if ( $object != "." && $object != ".." ) {
|
400 |
+
if ( filetype( $dir."/".$object) == "dir" ) wp_svg_icons_delete_entire_directory( $dir."/".$object); else unlink( $dir."/".$object );
|
401 |
+
}
|
402 |
+
}
|
403 |
+
reset( $objects );
|
404 |
+
rmdir( $dir );
|
405 |
+
}
|
406 |
+
}
|
readme.txt
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
=== WP SVG Icons ===
|
2 |
Contributors: eherman24
|
3 |
Donate link: https://www.evan-herman.com/contact/?contact-reason=I%20want%20to%20make%20a%20donation%20for%20all%20your%20hard%20work
|
4 |
Tags: wordpress, bootstrap, font icon, font awesome more, fontstrap, icons, ui, ux, design, free, boot, strap, menus, menu, custom, nav, navigation, navicons, icons, evan, herman, icon, set, svg, wp, icomoon, ico, moon, wp, zoom, wp-zoom, wpzoom, broccolidry, metoicons, iconic, plugin, responsive, bootstrap, font, awesome, font awesome, twitter, glyphicons, glyph, web, font, webfont, custom, icons, import, upload, zip, font, icon, svg font icon, fonticon, iconfont, fontello, css3, svg animation, free, genericons, genericon, icon stack, stack, icons stack, menu icons, menu, customizable, customize, customizer, bootstrap, dropdown, navigation, scale, vector, icons
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 3.1.8.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
-
Quickly and effortlessly enable 490+ beautifully designed SVG font icons, available on the frontend and backend of your site.
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -83,7 +83,7 @@ web fonts on to a new server every time. With this plugin its one click and you'
|
|
83 |
|
84 |
<strong>Custom Pack Installation</strong>
|
85 |
|
86 |
-
1. Visit <a href="http://icomoon.io/app/#/select">IcoMoon</a> and begin selecting icons you want to use.
|
87 |
2. Import icomoon icons from the library
|
88 |
3. select which icons you want to include in your pack
|
89 |
4. Click 'Font' at the bottom of the browser window
|
@@ -107,7 +107,7 @@ No. These icons are not .png or .jpg format. They are .svg (scalable vector grap
|
|
107 |
|
108 |
= Can you change the color of the icons? =
|
109 |
|
110 |
-
Yes, by adding the 'color' parameter to the shortcode, and then specifying either a hex, rgb or rgba color code.
|
111 |
For example :
|
112 |
`[wp-svg-icons icon="menu-2" wrap="i" color="#B4DA55"]`
|
113 |
|
@@ -138,11 +138,15 @@ If you buy the pro version you will also receive support and updates for one yea
|
|
138 |
2. Entire default icon pack collection. All available on initial install.
|
139 |
3. Custom icomoon font pack importer.
|
140 |
4. Brand new - generate your shortcode and enter icons into a post or page directly from the edit screen
|
141 |
-
5. Add icons to menu items without ever writing code - Pro Version Only -
|
142 |
-
6. Customize your icon before adding it to a page or post - Pro Version Only -
|
143 |
|
144 |
== Changelog ==
|
145 |
|
|
|
|
|
|
|
|
|
146 |
= 3.1.8.3 - September 17th, 2015 =
|
147 |
* Tweaks to latest update - removed 'Nice Try...' error message
|
148 |
|
@@ -208,7 +212,7 @@ If you buy the pro version you will also receive support and updates for one yea
|
|
208 |
= 2.3 =
|
209 |
* Fixed some URL structures to allow plugin to be used on localhost
|
210 |
* Updating some core functions
|
211 |
-
* Added new styles to dashboard icons
|
212 |
* Fixed hardcoded date in upload directory substring replacement, which caused issues when trying to upload or delete icon packs after January 2014 - released February 2nd, 2014
|
213 |
|
214 |
= 2.2.1 =
|
@@ -218,7 +222,7 @@ If you buy the pro version you will also receive support and updates for one yea
|
|
218 |
* Remove $hook parameter that was conditionally loading styles on admin end - prevented users from using icons in the dashboard
|
219 |
|
220 |
= 2.0 =
|
221 |
-
* Added <a href="http://www.icomoon.io">Icomoon</a> icon pack importer
|
222 |
* Fixed what dashboard pages styles/scripts get enqueued
|
223 |
* Adjusted styles to maintain consistency - January 15th, 2014
|
224 |
|
@@ -247,6 +251,10 @@ If you buy the pro version you will also receive support and updates for one yea
|
|
247 |
|
248 |
== Upgrade Notice ==
|
249 |
|
|
|
|
|
|
|
|
|
250 |
= 3.1.8.3 - September 17th, 2015 =
|
251 |
* Tweaks to latest update - removed 'Nice Try...' error message
|
252 |
|
@@ -311,7 +319,7 @@ If you buy the pro version you will also receive support and updates for one yea
|
|
311 |
= 2.3 =
|
312 |
* Fixed some URL structures to allow plugin to be used on localhost
|
313 |
* Updating some core functions
|
314 |
-
* Added new styles to dashboard icons
|
315 |
* Fixed hardcoded date in upload directory substring replacement, which caused issues when trying to upload or delete icon packs after January 2014 - released February 2nd, 2014
|
316 |
|
317 |
= 2.2.1 =
|
@@ -321,7 +329,7 @@ If you buy the pro version you will also receive support and updates for one yea
|
|
321 |
* Remove $hook parameter that was conditionally loading styles on admin end - prevented users from using icons in the dashboard
|
322 |
|
323 |
= 2.0 =
|
324 |
-
* Added <a href="http://www.icomoon.io">Icomoon</a> icon pack importer
|
325 |
* Fixed what dashboard pages styles/scripts get enqueued
|
326 |
* Adjusted styles to maintain consistency - January 15th, 2014
|
327 |
|
@@ -410,4 +418,4 @@ We've listened to your feature requests, and after many hours behind the keyboar
|
|
410 |
|
411 |
Now, you're no longer limited to the icons that come pre-packaged with the plugin. Create an unlimited number of custom icon combinations and start using them on your site in a matter of minutes.
|
412 |
|
413 |
-
<p> Check out the <a href="https://www.evan-herman.com/wp-svg-icons-pro/examples">demo page</a> for icon examples, the icon playground and code samples before downloading.</p>
|
1 |
+
=== WP SVG Icons ===
|
2 |
Contributors: eherman24
|
3 |
Donate link: https://www.evan-herman.com/contact/?contact-reason=I%20want%20to%20make%20a%20donation%20for%20all%20your%20hard%20work
|
4 |
Tags: wordpress, bootstrap, font icon, font awesome more, fontstrap, icons, ui, ux, design, free, boot, strap, menus, menu, custom, nav, navigation, navicons, icons, evan, herman, icon, set, svg, wp, icomoon, ico, moon, wp, zoom, wp-zoom, wpzoom, broccolidry, metoicons, iconic, plugin, responsive, bootstrap, font, awesome, font awesome, twitter, glyphicons, glyph, web, font, webfont, custom, icons, import, upload, zip, font, icon, svg font icon, fonticon, iconfont, fontello, css3, svg animation, free, genericons, genericon, icon stack, stack, icons stack, menu icons, menu, customizable, customize, customizer, bootstrap, dropdown, navigation, scale, vector, icons
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 4.8
|
7 |
+
Stable tag: 3.1.8.4
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
+
Quickly and effortlessly enable 490+ beautifully designed SVG font icons, available on the frontend and backend of your site.
|
12 |
|
13 |
== Description ==
|
14 |
|
83 |
|
84 |
<strong>Custom Pack Installation</strong>
|
85 |
|
86 |
+
1. Visit <a href="http://icomoon.io/app/#/select">IcoMoon</a> and begin selecting icons you want to use.
|
87 |
2. Import icomoon icons from the library
|
88 |
3. select which icons you want to include in your pack
|
89 |
4. Click 'Font' at the bottom of the browser window
|
107 |
|
108 |
= Can you change the color of the icons? =
|
109 |
|
110 |
+
Yes, by adding the 'color' parameter to the shortcode, and then specifying either a hex, rgb or rgba color code.
|
111 |
For example :
|
112 |
`[wp-svg-icons icon="menu-2" wrap="i" color="#B4DA55"]`
|
113 |
|
138 |
2. Entire default icon pack collection. All available on initial install.
|
139 |
3. Custom icomoon font pack importer.
|
140 |
4. Brand new - generate your shortcode and enter icons into a post or page directly from the edit screen
|
141 |
+
5. Add icons to menu items without ever writing code - Pro Version Only -
|
142 |
+
6. Customize your icon before adding it to a page or post - Pro Version Only -
|
143 |
|
144 |
== Changelog ==
|
145 |
|
146 |
+
= 3.1.8.4 - March 10th, 2015 =
|
147 |
+
* Fixed issue with icons not being selectable.
|
148 |
+
* Adjusted the limit check for the custom icons.
|
149 |
+
|
150 |
= 3.1.8.3 - September 17th, 2015 =
|
151 |
* Tweaks to latest update - removed 'Nice Try...' error message
|
152 |
|
212 |
= 2.3 =
|
213 |
* Fixed some URL structures to allow plugin to be used on localhost
|
214 |
* Updating some core functions
|
215 |
+
* Added new styles to dashboard icons
|
216 |
* Fixed hardcoded date in upload directory substring replacement, which caused issues when trying to upload or delete icon packs after January 2014 - released February 2nd, 2014
|
217 |
|
218 |
= 2.2.1 =
|
222 |
* Remove $hook parameter that was conditionally loading styles on admin end - prevented users from using icons in the dashboard
|
223 |
|
224 |
= 2.0 =
|
225 |
+
* Added <a href="http://www.icomoon.io">Icomoon</a> icon pack importer
|
226 |
* Fixed what dashboard pages styles/scripts get enqueued
|
227 |
* Adjusted styles to maintain consistency - January 15th, 2014
|
228 |
|
251 |
|
252 |
== Upgrade Notice ==
|
253 |
|
254 |
+
= 3.1.8.4 - March 10th, 2015 =
|
255 |
+
* Fixed issue with icons not being selectable.
|
256 |
+
* Adjusted the limit check for the custom icons.
|
257 |
+
|
258 |
= 3.1.8.3 - September 17th, 2015 =
|
259 |
* Tweaks to latest update - removed 'Nice Try...' error message
|
260 |
|
319 |
= 2.3 =
|
320 |
* Fixed some URL structures to allow plugin to be used on localhost
|
321 |
* Updating some core functions
|
322 |
+
* Added new styles to dashboard icons
|
323 |
* Fixed hardcoded date in upload directory substring replacement, which caused issues when trying to upload or delete icon packs after January 2014 - released February 2nd, 2014
|
324 |
|
325 |
= 2.2.1 =
|
329 |
* Remove $hook parameter that was conditionally loading styles on admin end - prevented users from using icons in the dashboard
|
330 |
|
331 |
= 2.0 =
|
332 |
+
* Added <a href="http://www.icomoon.io">Icomoon</a> icon pack importer
|
333 |
* Fixed what dashboard pages styles/scripts get enqueued
|
334 |
* Adjusted styles to maintain consistency - January 15th, 2014
|
335 |
|
418 |
|
419 |
Now, you're no longer limited to the icons that come pre-packaged with the plugin. Create an unlimited number of custom icon combinations and start using them on your site in a matter of minutes.
|
420 |
|
421 |
+
<p> Check out the <a href="https://www.evan-herman.com/wp-svg-icons-pro/examples">demo page</a> for icon examples, the icon playground and code samples before downloading.</p>
|
wp-svg-icons.php
CHANGED
@@ -7,8 +7,8 @@
|
|
7 |
* @wordpress-plugin
|
8 |
* Plugin Name: WP SVG Icons
|
9 |
* Plugin URI: https://www.evan-herman.com/wordpress-plugin/wp-svg-icons/
|
10 |
-
* Description: Quickly and effortlessly gain access to 492 beautifully designed SVG font icons, available on the frontend and backend of your site.
|
11 |
-
* Version: 3.1.8.
|
12 |
* Author: EH Dev Shop
|
13 |
* Author URI: http://evan-herman.com
|
14 |
* License: GPL-3.0+
|
@@ -40,11 +40,11 @@ function deactivate_wp_svg_icons() {
|
|
40 |
WP_SVG_Icons_Deactivator::deactivate();
|
41 |
}
|
42 |
|
43 |
-
/**
|
44 |
* The code that runs during plugin uninstall.
|
45 |
* This action is documented in includes/class-wp-svg-icons-uninstall.php
|
46 |
*/
|
47 |
-
function uninstall_wp_svg_icons() {
|
48 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-svg-icons-uninstall.php';
|
49 |
WP_SVG_Icons_Uninstall::uninstall();
|
50 |
}
|
@@ -72,4 +72,4 @@ function run_wp_svg_icons() {
|
|
72 |
$plugin = new WP_SVG_Icons();
|
73 |
$plugin->run();
|
74 |
}
|
75 |
-
run_wp_svg_icons();
|
7 |
* @wordpress-plugin
|
8 |
* Plugin Name: WP SVG Icons
|
9 |
* Plugin URI: https://www.evan-herman.com/wordpress-plugin/wp-svg-icons/
|
10 |
+
* Description: Quickly and effortlessly gain access to 492 beautifully designed SVG font icons, available on the frontend and backend of your site.
|
11 |
+
* Version: 3.1.8.4
|
12 |
* Author: EH Dev Shop
|
13 |
* Author URI: http://evan-herman.com
|
14 |
* License: GPL-3.0+
|
40 |
WP_SVG_Icons_Deactivator::deactivate();
|
41 |
}
|
42 |
|
43 |
+
/**
|
44 |
* The code that runs during plugin uninstall.
|
45 |
* This action is documented in includes/class-wp-svg-icons-uninstall.php
|
46 |
*/
|
47 |
+
function uninstall_wp_svg_icons() {
|
48 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-svg-icons-uninstall.php';
|
49 |
WP_SVG_Icons_Uninstall::uninstall();
|
50 |
}
|
72 |
$plugin = new WP_SVG_Icons();
|
73 |
$plugin->run();
|
74 |
}
|
75 |
+
run_wp_svg_icons();
|