Skip Navigation

[Resolved] views shortcodes and types_render_field are not showing line breaks properly

This support ticket is created 6 years, 2 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Shane 6 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1096996
wrapped-text.png

This is similar to a recent ticket I opened but the prior ticket was for termmeta, not custom fields and this broadens the issue to content getting filtered to not have blank lines in general, not just when I was using a method to get the term meta that didn't fully render the content. Christian helped with the prior issue.

I am trying to: Output custom WYSIWYG fields on a WooCommerce Product in a Toolset Layout

Link to a page where the issue can be seen:
hidden link
Look in specifications tab.

I expected to see:
Each bolded label and its text on separate lines

Instead, I got:
One long paragraph all wrapped together.

Disable auto paragraphs is not checked. This is in an Elementor gloabal tab widget with a types shortcode for the field inside. I've also tried putting just the field in its own visual editor cell outside of the elementor widget to make sure it wasn't Elementor causing the issue. If I use types_render_field I still get the wrapped text. If I use get_post_meta and wrap it in wpautop, I get what I expected to see. I've look in the database and the line ends are in the content so it is not an issue with the content being stored already wrapped. Even if I use get_post_meta in a shortcode I wrote that gets displayed in the visual editor cell without disable auto paragraphs checked, it comes out wrapped. Something is causing types to not be able to output with auto paragraphs and I can't figure out what the cause is.

If I use types_render_field and run that through wpautop, it still comes out wrapped so the line ends are removed by types_render_field before I get a chance to run it through wpautop.

I've tried disabling all the plugins that I can to see if one of them is adding a filter that is the problem but none seem to be the cause.

I cannot change the theme and obviously cannot disable WooCommerce or Toolset. The remaining factor seems to be Elementor with Toolset. If I put the types shortcode for the field into its own visual editor cell and disable the_content filters, I get the correct output. If I put the Elementor global widget with the tabs in it into a visual editor cell with the same settings, I get the problem output as it seems Elementor calls the_content filters whether the Toolset visual editor cell does or not. But, I'd really like the find the root cause ... which filter from where is doing this so talking the client out of using Elementor's tabs isn't the right solution.

I've checked through the Generatepress theme and haven't found any filter in there that might cause this issue.

#1097108

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Scott,

Thank you for contacting our support Forum.

Could you let me know what kind of field was the data entered in ?

Thanks,
Shane

#1097145

Hi Shane, it is a WYSIWYG custom post field. In case it matters, it is attached to the WooCommerce Product post type.

#1098669

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Scott,

Ok so in this case it should give the auto paragraphs.

When did this start happening ? Also have you tried doing a raw output ? By adding the raw attribute to the function ? If the p tags are added then they should get save in the database. As you mentioned the get_post_meta returns the correct results.

Try adding the raw attribute and see if this helps.

Thanks,
Shane

#1100732

Started happening within the last two weeks. Not sure exactly when.

Adding output='raw' doesn't seem to make a difference.

Something is clearly filtering the content but I cannot figure out what. If I turn off the_content filter in a normal Toolset cell, it outputs correctly. But I can't do that when the toolset types shortcode is in an Elementor widget such as the tabs widget because Elementor also calls the_content filters.

#1100812

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Scott,

Would you mind providing me with a duplicator package of the website so that I can test this ?

https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#1104834

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Scott,

Thank you as soon as you're able to provide me with a copy of the site please let me know so that I can re-enable the private fields.

Thanks,
Shane