Anyone know of the plugin that lets you selectively turn off the RTE, on a per-page or posts basis?
1 Answer
Off the top of my head, I don’t know of a plugin … but it’s easy enough to do this with a filter in your functions.php
file (or in a custom plugin.
This code, for example, turns off the rich text editor for everything with the post type “presentation”:
add_filter( 'user_can_richedit', 'disable_for_cpt' );
function disable_for_cpt( $allowed ) {
global $post;
if ( 'presentation' == get_post_type( $post ) ) {
$allowed = false;
}
return $allowed;
}
You could do whatever checks you need in this filter. Check if the post/page has a certain ID or a certain slug. Or even check if it’s in a specific category:
global $post;
if ( in_category( 'no_rte', $post ) ) {
// ...
Really, the sky’s the limit.