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
This commit is contained in:
Sergey Biryukov 2016-04-14 18:17:23 +00:00
parent 75fe71a13f
commit b24e181d17

View File

@ -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 ) {
) . '</p>',
'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
'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 : ?>
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
<form action="<?php echo esc_url( $args['action'] ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
<?php
/**
* Fires at the top of the comment form, inside the form tag.