Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function MYMODULE_form_alter (&$form, &$form_state, $form_id)
  2. {
  3. // comments
  4. // http://api.drupal.org/api/drupal/modules--comment--comment.module/function/comment_form/6
  5.  
  6. if ($form['#id'] == 'comment-form') {
  7. $form['comment_filter']['format'] = array(); // nuke wysiwyg from comments
  8. }
  9. }
  10.  
  11. /**
  12. * Implements hook_comment_form_alter().
  13. */
  14. function comment_form_alter(&$form, &$form_state, &$form_id) {
  15. $form['comment_body']['#after_build'][] = 'MYMODULE_customize_comment_form';
  16. }
  17.  
  18. /**
  19. * Comment body after-build function.
  20. */
  21. function MYMODULE_customize_comment_form(&$form) {
  22. // Hide text-format selector in comment form and fix format to filtered_html
  23. $form[LANGUAGE_NONE][0]['format']['format']['#value'] = 'filtered_html';
  24. $form[LANGUAGE_NONE][0]['format']['format']['#access'] = FALSE;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement