Skip Navigation

[Resolved] Brackets translated as shortcode in WYSIWYG field

This thread is resolved. Here is a description of the problem and solution.

Problem:

The text I'm inputting into the WYSIWYG field that contains brackets [], does not show up on the front-end

Solution:

You can output the wysiwyg field shortcode with attribute output='raw':
[types field='representative-publications' output='raw'][/types]

Relevant Documentation:

https://toolset.com/documentation/customizing-sites-using-php/functions/#wysiwyg

This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 11 replies, has 2 voices.

Last updated by jonathanR-5 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2128141
Screen Shot 2021-07-28 at 11.54.26 AM.png

The text I'm inputting into the WYSIWYG field that contains brackets [], does not show up on the front-end (see screenshot). It only shows up after I remove any brackets in the text. It seems that it sees them as a shortcode trying to be inserted? This seems to be a bug. I've tried both visual and text editor but no luck. As you can see, the Representative Publications section is therefore not showing up on the front-end: hidden link

#2128553
brackets.JPG

Hello,

I have tried it in a fresh WP installation + the latest version of Toolset plugins, it works fine, it does display the brackets [] correctly, see my screenshot brackets.JPG

So the problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again

3) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URLs, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2129019

see next post

#2129029
Screen Shot 2021-07-29 at 8.48.35 AM.png

I believe I'm using the legacy version? because I needed to create custom queries for the Views which wasn't possible with the Views block. Can you please confirm what needs to be updated that could potentially solve this issue? Screenshot attached.

#2129347

I can confirm it works fine in my localhost with the fresh WP installation + the latest version of Toolset plugins, see my screenshot above.

Please try as I mentioned above:
1) Backup your website first
2) Upgrade all Toolset plugins to the latest version
3) Deactivate all other plugins, and switch to WordPress default theme 2021, and test again

#2131707

I'd like to share some credentials with you so you can troubleshoot this. Please send me the private message option.

#2132029

I assume you have tried as I mentioned above:
https://toolset.com/forums/topic/brackets-translated-as-shortcode-in-wysiwyg-field/#post-2129347

Please provide your website database dump file in below private message box, you can put the package files in your own google drive disk, share the link only, also point out the problem page URLs. I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2133399
pmid.JPG

I can see the problem in your website, and I can install the duplicator package file in my localhost, strangely, it works fine in my localhost, see my screenshot: pmid.JPG

So it should be a server issue, please try to get the PHP debug logs from your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging

#2134135
Screen Shot 2021-08-04 at 1.46.08 PM.png

Hi, I turned on WP debug and saw the attached message quickly flash on the screen. I did go ahead and update all the plugins and no longer see the message and don't see that line of code in the functions.php file either but the problem still persists. Could it be a Cache for custom fields issue?

#2134297

Those debug logs are not related.

I have tried again in your website:
1) Edit the content template "Template for Faculty":
hidden link

Add a shortcode block, output the wysiwyg field shortcode with attribute output='raw':
[types field='representative-publications' output='raw'][/types]

2) Test it in front-end:
hidden link

It works fine.

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#wysiwyg

#2134839

OK I see what the issue is . After removing the conditionals, the text blocks with brackets show up. However, now I am back to trying to solve the original issue, why I started using conditionals around the fields, please refer to this ticket: https://toolset.com/forums/topic/arbitrary-breaks-between-shortcode-lines-on-front-end/#post-2119243
Without the conditionals wrapping the field, there are extra breaks between content when the field is empty. What is another solution to this??

#2134881

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.