I'm using Toolset to create a custom view for LearnDash lessons. My client has added a lot of custom fields to the Lession CPT. When I use a WYSIWYG fields in my view, I get a lot of LearnDash tags wrapped around my Toolset content. This breaks the formatting of
The accordion headers are the ones that have the extra content: hidden link. Do you know where the extra content might be coming from?
Please let me know if I can provide more information on my issue.
Thank you.
Hello, have you tried the suppress_filters attribute? It will prevent third-party filters from manipulating the contents of a WYSIWYG field. For example:
[types field="your-wysiwyg" suppress_filters="true"][/types]
I gave that a try and it's still being wrapped in divs that have learndash-* in the IDs and classes. Anything else I can try on the Toolset end? Thanks!
There is also a suppress_filters attribute on the wpv-post-body shortcode, if you're using one of those to display the information in a Content Template: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
Right now I can't really see anything, since it's all behind a login. It's difficult for me to guess without being able to see how everything is put together. Would you like to provide login credentials so I can take a closer look?
Christian,
I've got a little more detail for you about this issue. It looks like the extra LearnDash code is being wrapped around WYSIWYG fields using [types field=fieldname'][/types] shortcodes. If you look at the first section (Learning Objectives) on hidden link, the first block of text is from the wpv-post-body shortcode. When I add the suppress_filters="true" attribute to that shortcode, the extra LearnDash code is not added.
The Theme, Counting, and Site Words are single line fields. No extra LearnDash code is added to these types of fields. Images also don't appear to have extra code as well.
The Transition field is a WYSIWYG field. It adds the LearnDash code around it so that the Mark Complete button is prematurely shown. I've tried adding the suppress_filters="true" attribute to the [types] shortcode but the extra LearnDash code is still wrapped around it.
Please let me know if that helps.
Thanks,
Collin
Hi Collin,
Thanks for writing back and for sharing these details.
As Christian is on vacation, I'll be following up on this ticket.
The user that you've shared doesn't seem to have the "administrator" role, so I'm not able to see how shortcodes and the content of these fields are added in the backend.
Have you tried the WYSIWYG field's shortcode with the "output" attribute set to "raw"?
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#wysiwyg )
Example:
[types field="fieldname" output="raw"][/types]
In case the extra HTML is still being wrapped around the field, please change the role of the user that you've shared earlier to "administrator", so that I can see how everything set up and perform some tests on my own website, accordingly.
regards,
Waqar
My apologies for the wrong permissions. I think your fix did the trick for me though. My issue is resolved now. Thank you!