0

I have created a meta-box for a certain page_template.
So if the adminpage is loaded with the template it shows the metabox.

This does not require the wp-editor to add content. So I would like to hide or disable it.

I have searched the interwebs but they all came up with the disablement of the viaual editor or the html editor.

Anybody any ideas to do this with a function or some CSS?

M.

1

I believe the helper you're looking for (assuming we're not dealing with a custom post type) is:

<?php remove_post_type_support('page', 'editor'); ?>

When dealing with a custom post type you can exclude 'editor' from the 'supports' parameter to initialize the post type without the editor window.

Finally, if you are trying to disable the editor only when a specific page template is selected from the "Template" drop down menu, your best bet is likely a Javascript/jQuery approach to HIDE "#postdivrich" after an onChange event is triggered by "#page_template". Just remember to SHOW when the other templates that do support the editor are selected.

  • <?php remove_post_type_support('page', 'editor'); ?> did the trick!!! – Interactive Oct 1 '15 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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