wp_editor without removing extra linebreaks

As developers should already know WordPress 3.3 introduced the wp_editor function. This function renders the standard page/post edito in your custom themes and plugins.

Sometimes you want to format your content with a few extra linebreaks, but wordpress removes them when you save  your content.

To avoid this you can configure tinymce before init in your plugin:

function customizeEditor($in) {
  $in['remove_linebreaks']=false;
  $in['remove_redundant_brs'] = false;
  $in['wpautop']=false;
  return $in;
}
add_filter('tiny_mce_before_init', 'customizeEditor');
...

wp_editor(...);

You can find more customizations for your editor in the WordPress Codex.

As developers should already know WordPress 3.3 introduced the wp_editor function. This function renders the standard page/post edito in your custom themes and plugins.

Sometimes you want to format your content with a few extra linebreaks, but wordpress removes them when you save  your content.

To avoid this you can configure tinymce before init in your plugin:

function customizeEditor($in) {
  $in['remove_linebreaks']=false;
  $in['remove_redundant_brs'] = false;
  $in['wpautop']=false;
  return $in;
}
add_filter('tiny_mce_before_init', 'customizeEditor');
...

wp_editor(...);

You can find more customizations for your editor in the WordPress Codex.