If you updated to 4.8 WordPress you’ll notice a lot of nice improvements, but there is one thing that was done that I felt was like an artist over-working her painting: changing the Text widget to use a rich text editor. There are already plugins for that. The old pre 4.8 text widget was a way to add little snippets of html in your widgetized areas (aka sidebars). In many Genesis child themes, we rely on the text widget (pre 4.8) for arbitrary html. Now the new rich text editor does pretty much what the WordPress filters do in a post: strip empty tags and add paragraphs around line returns, so it wreaks havoc on the output IF you edit the content with the updated widget and your html wasn’t completely minified when you pasted it in there.
When I noticed this, first I thought I’d use a filter and a shortcode, but that didn’t work out. Instead I forked the pre 4.8 text widget class and turned it into a plugin, then I asked for someone else to fork that and do the finishing touches for the WordPress plugin repo. Victor Font did just that and now, while we wait for the approval (takes a few weeks), you can download the zip at the WordPress repository with the link below:
How to Use
The slow way of doing it, you would manually copy out the code from the Text widget to the the Classic Text Widget. That can take a long time if you have many sites to update. But doing it this way will also be a problem because, depending on what was in the Text widget, it can be empty (this happened with FontAwesome) for me and others with similar empty tags using pseudo elements in CSS. So what I did was to view the site in the browser before I touched the widgets and get my parsed html from the source code. This is very time consuming.
Here is a much faster and safer way to bulk transfer if you are not adept at using
phpMyAdmin and tweaking
wp_options table (and possibly others) for serialized data (which is tricky to work with).
First get the new plugin:
Install it and activate it using the upload plugin button. Read your screen.
Then install and activate the Widget Importer Exporter Plugin from the WordPress repo.
Using that plugin, export your current widgets to a .wie file.
On your local drive, duplicate the .wie file that was generated and rename it something else. Open that renamed .wie file in a code editor (not a word processor).
Find and replace all using the following 2 strings (exact). Make sure you are at the top of the file.
Don’t forget any of the string including the
" and the
Note that this is not a curly quote, it’s the inch mark and the dash is a hyphen.
Now using the Widget Importer Exporter plugin, import that renamed .wie file you just found and replaced inside. Don’t worry: existing widgets will not be replaced, the only ones that will be ADDED are duplicates of the text widget but are using the new Classic Text widget. Yay, way faster than by hand and your content stays intact.
The final step is to toggle each sidebar/widetized area and either drag to inactive or delete the ones that are titled “Text: xxxx” and NOT “Classic Text Widget: xxx” or “Text” and NOT “Classic Text Widget” if you didn’t have titles in your widget.
All the best,
Affiliate Notice: I have affiliate links all over the place for companies I recommend. By purchasing through these links you help to support my family and to keep my blog going.