elliotcondon/acf — pull request #289 by sullinger (2014-06-18 19:45:49+00:00)
Title: Changed output of richedit wysiwyg editor to use the_editor_content filter.

Hey @elliotcondon

currently I have a client that wants to move his site over to a WordPress Blog. He wants to keep the markup for SEO purposes.

To make this possible, I need to deactivate wpautop. I already managed to do it for the default WordPress editor using the following code within the functions.php

```
// disable wpautop
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
remove_filter( 'acf_the_content', 'wpautop' );

// set forced_root_block to false and use br for newlines
function change_mce_options( $init )
{
$init[ 'forced_root_block' ] = false;
$init[ 'force_br_newlines' ] = true;
$init[ 'force_p_newlines' ] = false;
$init[ 'convert_newlines_to_brs' ] = true;

return $init;
}

add_filter( 'tiny_mce_before_init', 'change_mce_options' );
```

and the [Preserved HTML Editor Markup](http://wordpress.org/plugins/preserved-html-editor-markup/) plugin.

Unfortunately it does not work with the WYSIWYG editor of your plugin (yet). I dived into WordPress' source code and found out that they are using the_editor_content filter (see [class-wp-editor.php](https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-editor.php#L231)).

Then I had a look at your plugin and tried to find a reasonable solution – so everyone will be happy. It allows to remove the wpautop using remove_filter in the functions.php.