Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including
Stack Overflow
, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this community
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am using the simple fields plugin to provide additional rich text editors and have no need for this 'main' text editor box on any of my 'page's
I have tried the following code in my functions.php:
function my_remove_meta_boxes() {
remove_meta_box('postdivrich','page','normal');
add_action( 'admin_menu', 'my_remove_meta_boxes' );
Apparently this will not work since it is not actually a meta box...
I suppose I could sneak some jQuery in somewhere: ('#postdivrich').hide() but I am not really sure where to put it, and suspect that there is a better way.
Any help would be greatly appreciated
Edit: this question describes how to do what I want, but for a custom post type. Can I apply this same technique to 'pages' somehow?
Edit 2: Using noob power I made something work, but for all post-types and with it flashing on screen before being hidden. I skipped JQuery and went straight for plain ole JS:
//REMOVE MAIN TEXT CONTENT BOX FOR PAGES
function removeMainTxtContent(){
echo '<script>window.onload=function(){document.getElementById("postdivrich").style.display="none";}</script>';
}add_action('admin_head', 'removeMainTxtContent');
–
–
To completely remove the text editor from your custom post type, add this into functions.php:
function remove_editor() {
remove_post_type_support( 'your_post_type', 'editor' );
add_action( 'admin_menu' , 'remove_editor' );
Thanks for contributing an answer to WordPress Development Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.