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.

Is it possible to remove the Visual \ HTML tabs from wp_editor and display only the TinyMCE editor?

Basically, right now, I'm using wp_editor to display the smallest possible TinyMCE editor I can - only one button is needed, italics.

Current TinyMCE instnace

What I'd like to do is make that smaller by removing the Visual \ HTML tabs. Our authors won't ever need the HTML editor and the custom buttons I'm creating will only be accessible from the visual editor.

NOTE: For reasons found here, I can't use the teeny argument of wp_editor.

Thanks in advance,

share|improve this question
add comment

5 Answers

up vote 8 down vote accepted

Just set 'quicktags' parameter of the settings array to false.

wp_editor('', 'some-id', array('quicktags' => false) );
share|improve this answer
    
No idea why I didn't think of this. Thanks! –  dunc Apr 18 '12 at 12:56
add comment

You can hide both from view using this code in your theme's functions.php file:

//Hide Post Page Options from ALL users
function hide_all_post_page_options() {
global $post;
$hide_all_post_options = "<style type=\"text/css\"> #content-html, #content-tmce { display: none !important; }</style>";
print($hide_all_post_options);
}
add_action( 'admin_head', 'hide_all_post_page_options'  );
share|improve this answer
    
Hi Travis. This has had no effect on my page, even when I simply add those lines to my plugin's CSS file. –  dunc Apr 16 '12 at 15:13
    
Quite honestly, I am no coder. This is the code I always use to hide areas of the new post page. I just add it to my theme's functions.php file and have never had any problems. I can tell you though, the css that styles the tabs is located in /wp-includes/css/editor-buttons.css. –  Travis Pflanz Apr 16 '12 at 15:32
    
You might want to try to clear your cache after implementing the above code. I have used it in code on a new site today and tested it on an existing site. Both worked perfectly. –  Travis Pflanz Apr 16 '12 at 20:14
add comment

The code provided by ungestaltbar works great, but I wanted it to work for bbPress (2.2.x) as well. I found this to be very easy and clean as well;

In the template files (only copy the files you need from wp-content/plugins/bbpress/templates/default/bbpress to your theme folder, into a folder called bbpress, for example wp-content/themes/mytheme/bbpress) you'll find numerous calls to:

bbp_the_content( array( 'context' => 'reply' ) );

In your template files replace a call like this with (ie. add: 'quicktags' => false);

bbp_the_content( array( 'context' => 'reply', 'quicktags' => false ) );

The calls can be found in all form-xyz.php files.

share|improve this answer
add comment

Try install this plugin: http://wordpress.org/plugins/disable-visual-editor-wysiwyg/ Simple and fast! :D

share|improve this answer
1  
Link only answers are discouraged. If something happens to that link the answer becomes useless. Please try to make your answer here stand alone. –  s_ha_dum Jun 18 '13 at 13:45
add comment
add_filter( 'admin_footer', 'removes_editor_visual_tab', 99 );

function removes_editor_visual_tab()
{
    ?>
    <style type="text/css">
    a#content-tmce, a#content-tmce:hover {
        display:none;
    }
    </style>';
    <script type="text/javascript">
    jQuery(document).ready(function() {
        document.getElementById("content-tmce").onclick = 'none';
    });
    </script>'
    <?php
}
share|improve this answer
add comment

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.