hide Input Format Options and help text under a textarea

Public

How to hide Input Format Options and help text under a textarea?

via - http://drupal.stackexchange.com/questions/12220/how-to-hide-input-format...

1. you can use the Simplify (drupal.org/project/simplify) module. It allows you to hide the Text Format options textarea, as well as other elements on node forms.

2. You can use hook_form_alter in a custom module to do this.

</> CopyGet raw version
php
  1. // hook_form_alter function
  2. function CUSTOM_MODULE_form_alter(&$form, &$form_state, $form_id) {
  3. // We want this on a specific node type
  4. if ($form_id == 'NODE_TYPE_node_form') {
  5. $form['#after_build'][] = 'CUSTOM_MODULE_NODE_TYPE_node_form_after_build';
  6. }
  7. }
  8.  
  9. // afterbuild function
  10. function CUSTOM_MODULE_NODE_TYPE_node_form_after_build($form) {
  11. // We want this on a specific field
  12. $form['YOUR_FIELD']['und']['0']['format']['#access'] = FALSE;
  13. return $form;
  14. }