Skip to content

Instantly share code, notes, and snippets.

@schurpf
Created October 9, 2014 21:06
Show Gist options
  • Save schurpf/e2188f8e0c31c9f2010c to your computer and use it in GitHub Desktop.
Save schurpf/e2188f8e0c31c9f2010c to your computer and use it in GitHub Desktop.
php: echo ACF without wrapping p tags
/**
* ACF without paragraphs
* @author schurpf
* @url http://schurpf.com
* @version 0.0
* @date 2014-10-09
* @dependency [none]
* @param string $field_name your normal ACF field name
* @return none echos field without wrapping p tags
* @source http://support.advancedcustomfields.com/forums/topic/removing-paragraph-tags-from-wysiwyg-fields/
*/
function the_field_without_wpautop( $field_name ) {
remove_filter('acf_the_content', 'wpautop');
the_field( $field_name );
add_filter('acf_the_content', 'wpautop');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment