Remove Preview Button from Node Form

Public

Remove preview button from Node Form

</> CopyGet raw version
php
  1. /**
  2.   * Form Alter hook
  3.   */
  4. function MODULE_form_alter(&$form, $form_state, $form_id) {
  5.  
  6. if ($form_id == 'article_node_form') {
  7.  
  8. unset($form['actions']['preview']);
  9. }
  10. }

Comments

jrohit's picture

Instead of unset an array, we should mark #access = FALSE;