Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How should I completely disable the visual and html editor from pages? I know I can disable the visual editor in my profile, but I am trying to lock down the content input areas so that my client doesn't muck things up.

share|improve this question
    
I would be interested in learning why you'd lock the content and not educate your client? After all idea with WordPress site is that client is able to update their content. –  Azizur Jun 26 '11 at 22:53
1  
Everything is split into custom meta boxes, so really the editor is just getting in the way. Everything is in meta boxes to keep a decent structure to the page. Really it's not worth going into here, but trust me this is the best way for this particular site. –  Tom Jun 26 '11 at 23:23

2 Answers 2

up vote 3 down vote accepted

Why not use custom post types and don't add any support for the editor, that is afterall what they are for and the easiest way . The answer in this post covers how to do that,

Hide content box with Custom Post Type ?
http://codex.wordpress.org/Function_Reference/register_post_type

To remove that functionality for pages or posts (and custom types) you can try and use remove_post_type_support . For pages;

add_action('init', 'my_remove_editor_from_post_type');
function my_remove_editor_from_post_type() {
    remove_post_type_support( 'page', 'editor' );
}

Ref: http://codex.wordpress.org/Function_Reference/remove_post_type_support

A hacky solution is to use CSS display:none; for the #editorcontainer or one of the sub id or classes. You can also then enqueue that style only for particular users.

share|improve this answer

Think this might be what your looking for, code and more info from wpsnipp:

add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );
add_action( 'admin_head', 'disable_html_editor_wps' );
function disable_html_editor_wps() {
global $current_user;
get_currentuserinfo();
if ($current_user_can('manage_options') {
    echo '<style type="text/css">#editor-toolbar #edButtonHTML, #quicktags {display: none;}</style>';
}
}

i've altered it from using user levels to using if ($current_user_can('manage_options') { so this should remove it for everybody but admin, code needs to gi in your themes functions.php

share|improve this answer
1  
Why not simply take current_user_can( 'manage_options' );? Jes, there's a function for each & everything ;) –  kaiser Jun 26 '11 at 22:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.