From 8e498b933d45e649afaaed81f699d9ae99e0c664 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 14 Apr 2016 18:18:29 +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. Built from https://develop.svn.wordpress.org/trunk@37208 git-svn-id: http://core.svn.wordpress.org/trunk@37174 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 5 ++++- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 29b102a207..09969c81da 100644 --- a/wp-includes/comment-template.php +++ b/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 : ?> -
> + >