Skip Navigation

[Resolved] Remove wpautop filter from Toolset custom fields

This support ticket is created 7 years, 5 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 7 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#452963

IN order to get the CM Tooltip glossary plugin to work on my text fields I had to apply the "content" filter to these fields like this:

add_filter( 'wpcf_fields_value_display', 'apply_the_content' );
function apply_the_content( $value ) {
	return apply_filters( 'the_content', $value );
}

However the knock-on effect is that now all the fields are wrapped in <p></p> tags by the wpautop filter. Is there any way I can disable this wpautop filter on the Toolset fields display?

#453072

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try to use shortcode: [wpv-noautop]

For example:

[wpv-noautop]
provider: [wpv-post-field name="provider_type"],
industry: [wpv-post-field name="industry"],
featured: [wpv-post-field name="featured_image"]
[/wpv-noautop]

More info:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-noautop

#453075

How would I use that shortcode within a php template file situation?

#453081

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Disable 'autop' filter, by putting following code in your theme's functions.php:

remove_filter('the_content', 'wpautop');

Please note that:
This will disable autop site-wide. You can encapsulate it in an appropriate event/action/hook, to disable at particular time. Please see View Filters API at https://toolset.com/documentation/user-guides/views-filters/ for a suitable action.

OR

You may try to use third party plugin:
=> https://wordpress.org/plugins/ps-disable-auto-formatting/

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