Custom icons broken
-
Hey, I have this installed on a website with custom icons and there are these problems:
1. The links are not working on frontend (widget)
2. The links are saved but not displayed after refresh in admin panelI fixed them very easy with one small adjustment:
Your original code has something missing in this part of the code/* * Escape custom icons url */ if( isset($_POST["sfsi_custom_links"]) && !empty($_POST["sfsi_custom_links"]) ) { $esacpedUrls = array(); $sfsi_customIconsUrl = $_POST["sfsi_custom_links"]; foreach($sfsi_customIconsUrl as $sfsi_customIconUrl) { $esacpedUrls[] = esc_url($sfsi_customIconUrl); } }
The
$esacpedUrls
array is saving the links, but when you return them you return them with numeric IDs (in my case I had 3,4,5), but this variable saves them with the IDs 0,1,2. All you need is one small change to save the IDs you got from JS to this:foreach($sfsi_customIconsUrl as $key => $sfsi_customIconUrl) { $esacpedUrls[$key] = esc_url($sfsi_customIconUrl); }
I changed mine, but there might be some other people with this issue.
Thanks!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Custom icons broken’ is closed to new replies.