Skip Navigation

[Gelöst] Remove wpautop filter from Toolset custom fields

This support ticket is created vor 7 Jahre, 4 Monate. 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
- 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 Antworten, has 2 Stimmen.

Last updated by Minesh vor 7 Jahre, 4 Monate.

Assisted by: Minesh.

Author
Artikel
#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: Englisch (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: Englisch (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.