I’m attempting to save a text widget with backslashes, but they’re being removed no matter what. I’ve tried using the default WP text widget (the “arbitrary text widget” one), as well as created a custom widget with a single input. I’ve gotten close by adding a str_replace to replace all single backslashes with double backslashes, that works when actually editing the field, but when I update the page without making a change to the field, it gets removed. Any ideas? Is there any way to prevent the stripslashes on page save?
Unable to save text widgets with backslashes, always getting removed.
Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.
Hi Brmoore,
This is basically related to how we’re storing data. We’ve resolved this issue and a fix will be included in the next update. If you’re familiar with PHP, you might be able to apply the code directly to the current version – you can find the issue here. Sorry about this!
Thanks Alex,
Thanks for your reply! I was looking at applying the code to my version (2.4.25), and it looks like there are a lot of files that have been added. I can try downloading the whole dev branch and see if that works. Do you know when the next update will be released?
Hi Brmoore,
Ah. Yeah, I can see why that’s confusing. There’s currently no ETA.
In the current release version please open siteorigin-panels.php and search for:
Replace that entire line with this line.
Search for:
Replace that line with this line.
Replace that line with this line.
Add this function (ensure it’s not inside of another function) and remove public static (we’re not using a large class in 2.4).
Open inc/revisions.php and replace:
Replace that line with this line.
Please note that I cannot assist with issues related to incorrect copy and pasting so please be sure you’re very careful.