Grid view formatting gets stripped

By: Paul Bruikman | Asked: 11/13/2023
ForumsCategory: General questionsGrid view formatting gets stripped
Paul Bruikman asked 1 year ago
It happens to me often that after I build a grid view and safe it, it looks fine and works. Then, at random times, when I come back to edit that view all my line end formatting is gone and also some of the html has been stripped. For instance <a href="/some-page/?user=[761 show="ID"] target="_blank" rel="noopener noreferrer">Click here</a> turns into <a href="/some-page/?user=[761 show= target="_blank" rel="noopener noreferrer">Click here</a> and also all my paragraph ends have disappeared. so this:

[icon name="user-o" class="" unprefixed_class=""] [415] [384]

[icon name="birthday-cake" class="" unprefixed_class=""] [385] [390]
[391] [392] [icon name="envelope" class="" unprefixed_class=""] [387]
[icon name="phone" class="" unprefixed_class=""] [388]
[icon name="id-badge"]
Klantnummer: [413]
[icon name="industry"] Beroep: [2301] Afspraak: [1666] [1664 format="l d F Y"] [1665] Datum laatste update: [761 show="datum_update_ingevuld" ] ([2885])   turns into this:  

[icon name="user-o" class="" unprefixed_class=""] [415] [384]

[icon name="birthday-cake" class="" unprefixed_class=""] [385] [390] [391] [392] [icon name="envelope" class="" unprefixed_class=""] [387] [icon name="phone" class="" unprefixed_class=""] [388] [icon name="id-badge"] Klantnummer: [413] [icon name="industry"] Beroep: [2301] Afspraak: [1666] [1664 format="l d F Y"] [1665] Datum laatste update: [761 show="datum_update_ingevuld" ] ([2885])   I fix it, then it works again for a while (or a minute) and suddenly it is "sanitised" again. What's going on here, anyone recognise this behaviour?
4 Answers
Paul Bruikman answered 1 year ago
Interesting, the forum does the same thing.
Paul Bruikman answered 1 year ago
This is what I mean
Attachments
Victor Font answered 1 year ago
It's probably the wp_kses function in WordPress doing this. https://developer.wordpress.org/reference/functions/wp_kses/. Formidable still uses the legacy TinyMCE editor. Don't ever use the editor in visual mode when you include custom code. Use the text panel only. On the view's advanced settings page, you could set the filter content dropdown to Formidble shortcodes only insetad of running things throup wpautop, which should be disabled as well. https://developer.wordpress.org/reference/functions/wpautop/
Paul Bruikman answered 1 year ago
Hey Victor, I indeed suspect that it has something to do with code stripping but can't find the logic behind it or the on-off switch. I do all my editing in the text panel. It then looks good, I save it and (sometime) when I come back the code is stripped. So I keep a copy of my code on a notepad or in BBedit so that I can paste it back. This happened to me before in the classic views also btw. I've just tried your suggestion, set my view to " Run Formidble shortcodes only". But it immediately got jumbled again. It also is very specific in the stripping now.  It turns this: <a href="/nieuw-EMI-rapport-voor-klant/?user=[761 show="ID"] target="_blank" rel="noopener noreferrer">Maak een EMI</a> Into this: <a href="/nieuw-EMI-rapport-voor-klant/?user=[761 show=" target="_blank" rel="noopener noreferrer"> The target = blank modifier is now also completely useless. I guess the only fix is to make a new view again and hope it lasts longer than the previous before it starts bugging.  
Paul Bruikman replied 1 year ago

<p><p>By the way, why can't we use proper line ends here?<br> My text looks like letterspaghetti.</p></p>

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right