Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » Possible to remove auto p (wpautop) in Types fields?

  • I’m using :

    remove_filter('the_content', 'wpautop');

    to stop p and br tags appearing in the content. However, they are still appearing in custom fields created by Types. I have tried to prevent this happening with this:

    remove_filter('types_render_field', 'wpautop');

    But it has no effect. What is the correct way to prevent Types custom fields auto adding p and br tags?

    https://wordpress.org/plugins/types/

Viewing 1 replies (of 1 total)
  • Hey Ben,

    I was wondering the same thing, and I did find an answer, tho not from the plugin creator.

    Instead of writing
    echo(types_render_field("your-field-name")) I used PHP’s strip_tags to remove any added code to the field:
    echo strip_tags((types_render_field("your-field-name"))); ?>

    This has the added benefit of removing the P tags for only the field it’s applied to, which was an advantage for me.

    If you’re looking to remove from ALL the fields generate I can’t help you beyond adding strip_tags to every field, which I know would be irritating.

    Good luck!

Viewing 1 replies (of 1 total)
  • The topic ‘Possible to remove auto p (wpautop) in Types fields?’ is closed to new replies.