Ajouter functions.php
This commit is contained in:
commit
75992faa5d
1 changed files with 23 additions and 0 deletions
23
functions.php
Normal file
23
functions.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
$files = scandir(get_stylesheet_directory().'/icons2');
|
||||
function store_svg_icons_to_json($files) {
|
||||
|
||||
$json_svgs=[];
|
||||
foreach($files as $file) {
|
||||
|
||||
if($file!='.' && $file!='..'){
|
||||
|
||||
$name = str_replace('.svg','',$file);
|
||||
$icon = esc_html(file_get_contents(get_stylesheet_directory().'/icons2/'.$file));
|
||||
$icon = str_replace('http://www.w3.org/2000/svg">','',$icon);
|
||||
$jsons_svgs[] = [
|
||||
'name'=>$name,
|
||||
'icon'=>str_replace('http://www.w3.org/2000/svg">','',$icon)
|
||||
];
|
||||
}
|
||||
}
|
||||
return $jsons_svgs;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue