Created
January 23, 2012 15:03
-
-
Save bueltge/1663554 to your computer and use it in GitHub Desktop.
Code to Question on WPSE questions 39843
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Remove br in pre | |
* Plugin URI: http://wordpress.stackexchange.com/questions/39843/no-filter-of-code-on-switch-from-html-to-visual-editor-how | |
* Text Domain: | |
* Domain Path: /languages | |
* Description: | |
* Version: beta | |
* Author: Frank Bültge | |
* Author URI: http://bueltge.de | |
* License: GPLv3 | |
*/ | |
remove_filter( 'tiny_mce_before_init', '_mce_set_direction' ); | |
add_filter( 'tiny_mce_before_init', 'fb_tinymce', 9 ); | |
function fb_tinymce( $init ) { | |
$init['fix_list_elements'] = FALSE; | |
$init['wpautop'] = FALSE; | |
$init['remove_linebreaks'] = FALSE; | |
$init['apply_source_formatting'] = TRUE; | |
$init['extended_valid_elements'] .= ',pre[*],code[*]'; | |
return $init; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alternative via JS; basically a add on for editor.js