Featur section rewriting code

Hi, thanks for the theme Shapely.

I saw an earlier post regarding this issue but it was a year ago so I make a new one,
I have the same problem with the feature section as others seem to have:

The text/code that should be in a feature is:

<ul>
 	<li>1-2 månader drifttid</li>
 	<li>Trådlös, samtidig laddning</li>
</ul>

But everytime I open that widget for editing the text/code is changed to:

<ul>
 	<li style="list-style-type: none;">
<ul>
 	<li>1-2 månader drifttid</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li style="list-style-type: none;">
<ul>
 	<li>Trådlös, samtidig laddning</li>
</ul>
</li>
</ul>
&nbsp;

&nbsp;

So empty <ul>:s are added together with &nbsp;'s at the end

I’m not shure if is is the theme functions/js or WP it self that rewrites my code.
My page is on a dev server so at the moment it is not public. But I can make it so if it helps.
I’ve looked into the DB and the first written code saved in to the DB is correct, it’s what I wrote, but if I open the feature section and save it, even without editing it, the code above gets added.

Something is rewriting the code.

Hey there

Well, yes, I’m aware on this problem however its not related to the theme, its text editor issue, try to work in the text mode rather than visual and you will not have the problem
Yes, I know this is not a “Solution” but there is no other alternative at this moment :slight_smile:

After the latest update of the theme my problems got even worse.
First I replaced the feature widget with a block containing the html-code I wanted.

So, while lookin into the file:
plugins/shapley-companion/inc/widget/class-shapley-home-features.php
I noticed some nl2br functions. In my world that one are known for often not functioning.

Anyway, I took them out and atleast the problems with rewriting seems a lot lesser with the features widget. I have to try more.

I also might try removing the use of wp_kses_post() since - also in my little world - it sometimes adds more problems than it solves. My problems above might be a combination of nl2br and wp_kses_post()

Hi Per

Thanks for sharing those details, those functions are added for security reasons, to filter data entered by users in the text fields, I belive you can use them without those functions :slight_smile: