Snippet: Readonly TinMCE for selected post types

Add following snippet to “functions.php”

Snippet


add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
function myformatTinyMCE($in)
{
	global $post;
	if($post->post_type=='my_post_type') 
		$in['readonly']='1';
	return $in;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>