How would one override the default "Save" button text on the Comment Form?

I've tried the following in my template.php file:

function node_comment_block_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'comment_form') {
    $form['actions']['submit']['#value'] = 'Post Comment';
  }
}
function node_comment_block_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'comment-form') {
    $form['actions']['submit']['#value'] = 'Post Comment';
  }
}

Unless this is a future feature enhancement, I'd rather not modify the module itself since I'll probably forget and apply a future update and override my changes.

Thanks.

Comments

opdavies’s picture

Status: Active » Closed (won't fix)

I don't think that this is something that we should include within the module, so I'd suggest using a hook_form_alter or hook_form_FORM_ID_alter within a theme's template.php file or within a custom module to make the specific change needed for a site.