Created
July 14, 2020 10:39
-
-
Save Mamaduka/ddb776a046776926c802b3b36786a0be to your computer and use it in GitHub Desktop.
Force TinyMCE in WordPress to paste as plain text.
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 | |
/** | |
* Configure "Paste" plugin before TinyMCE init. | |
* | |
* @param array $mceInit | |
* @return array $mceInit | |
*/ | |
add_filter( 'tiny_mce_before_init', function( $mceInit ) { | |
$mceInit['paste_as_text'] = true; | |
return $mceInit; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment