From b24e181d17ac2fbcc4e8621fc3ac4bd2f55f7f70 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 14 Apr 2016 18:17:23 +0000 Subject: [PATCH] Comments: Allow for default comment form action, `/wp-comments-post.php`, to be changed via the `comment_form_defaults` filter. Props cliffseal. Fixes #26841. git-svn-id: https://develop.svn.wordpress.org/trunk@37208 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment-template.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index 29b102a207..09969c81da 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -2065,6 +2065,7 @@ function wp_list_comments( $args = array(), $comments = null ) { * 'cancel_reply_before', and 'cancel_reply_after' arguments. * @since 4.5.0 The 'author', 'email', and 'url' form fields are limited to 245, 100, * and 200 characters, respectively. + * @since 4.6.0 Introduced the 'action' argument. * * @param array $args { * Optional. Default arguments and form fields to override. @@ -2083,6 +2084,7 @@ function wp_list_comments( $args = array(), $comments = null ) { * if the user is not logged in. * Default 'Your email address will not be published.'. * @type string $comment_notes_after HTML element for a message displayed after the textarea field. + * @type string $action The comment form element action attribute. Default '/wp-comments-post.php'. * @type string $id_form The comment form element id attribute. Default 'commentform'. * @type string $id_submit The comment submit element id attribute. Default 'submit'. * @type string $class_form The comment form element class attribute. Default 'comment-form'. @@ -2164,6 +2166,7 @@ function comment_form( $args = array(), $post_id = null ) { ) . '

', 'comment_notes_before' => '

' . __( 'Your email address will not be published.' ) . ''. ( $req ? $required_text : '' ) . '

', 'comment_notes_after' => '', + 'action' => site_url( '/wp-comments-post.php' ), 'id_form' => 'commentform', 'id_submit' => 'submit', 'class_form' => 'comment-form', @@ -2228,7 +2231,7 @@ function comment_form( $args = array(), $post_id = null ) { */ do_action( 'comment_form_must_log_in_after' ); else : ?> -
> + >