apply_filters( 'comment_form_submit_field', string $submit_field, array $args )

Filters the submit field for the comment form to display.


The submit field includes the submit button, hidden fields for the comment form, and any wrapper markup.

Top ↑


$submit_field string
HTML markup for the submit field.
$args array
Arguments passed to comment_form() .
More Arguments from comment_form( ... $args ) Default arguments and form fields to override.
  • fieldsarray
    Default comment fields, filterable by default via the 'comment_form_default_fields' hook.
    • authorstring
      Comment author field HTML.
    • emailstring
      Comment author email field HTML.
    • urlstring
      Comment author URL field HTML.
    • cookiesstring
      Comment cookie opt-in field HTML.
  • comment_fieldstring
    The comment textarea field HTML.
  • must_log_instring
    HTML element for a 'must be logged in to comment' message.
  • logged_in_asstring
    HTML element for a 'logged in as [user]' message.
  • comment_notes_beforestring
    HTML element for a message displayed before the comment fields if the user is not logged in.
    Default 'Your email address will not be published.'.
  • comment_notes_afterstring
    HTML element for a message displayed after the textarea field.
  • actionstring
    The comment form element action attribute. Default '/wp-comments-post.php'.
  • id_formstring
    The comment form element id attribute. Default 'commentform'.
  • id_submitstring
    The comment submit element id attribute. Default 'submit'.
  • class_containerstring
    The comment form container class attribute. Default 'comment-respond'.
  • class_formstring
    The comment form element class attribute. Default 'comment-form'.
  • class_submitstring
    The comment submit element class attribute. Default 'submit'.
  • name_submitstring
    The comment submit element name attribute. Default 'submit'.
  • title_replystring
    The translatable 'reply' button label. Default 'Leave a Reply'.
  • title_reply_tostring
    The translatable 'reply-to' button label. Default 'Leave a Reply to %s', where %s is the author of the comment being replied to.
  • title_reply_beforestring
    HTML displayed before the comment form title.
    Default: <h3 id="reply-title" class="comment-reply-title">.
  • title_reply_afterstring
    HTML displayed after the comment form title.
    Default: </h3>.
  • cancel_reply_beforestring
    HTML displayed before the cancel reply link.
  • cancel_reply_afterstring
    HTML displayed after the cancel reply link.
  • cancel_reply_linkstring
    The translatable 'cancel reply' button label. Default 'Cancel reply'.
  • label_submitstring
    The translatable 'submit' button label. Default 'Post a comment'.
  • submit_buttonstring
    HTML format for the Submit button.
    Default: <input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />.
  • submit_fieldstring
    HTML format for the markup surrounding the Submit button and comment hidden fields. Default: <p class="form-submit">%1$s %2$s</p>, where %1$s is the submit button markup and %2$s is the comment hidden fields.
  • formatstring
    The comment form format. Default 'xhtml'. Accepts 'xhtml', 'html5'.

Top ↑


File: wp-includes/comment-template.php. View all references

echo apply_filters( 'comment_form_submit_field', $submit_field, $args );

Top ↑


Version Description
4.2.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.