From 1d0774e784f014b61749d4e2d3b60c2380067dad Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 18 Sep 2015 19:18:26 +0000 Subject: [PATCH] Add `title_reply_before` and `title_reply_after` args to `comment_form()` to allow the "Leave a Reply" heading level to be changed. Props tyxla. Fixes #33775. Built from https://develop.svn.wordpress.org/trunk@34308 git-svn-id: http://core.svn.wordpress.org/trunk@34272 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 22 +++++++++++++++++++++- wp-includes/version.php | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index af375c533f..79b51c1a98 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1881,6 +1881,7 @@ function wp_list_comments( $args = array(), $comments = null ) { * @since 3.0.0 * @since 4.1.0 Introduced the 'class_submit' argument. * @since 4.2.0 Introduced 'submit_button' and 'submit_fields' arguments. + * @since 4.4.0 Introduced 'title_reply_before' and 'title_reply_after' arguments. * * @param array $args { * Optional. Default arguments and form fields to override. @@ -1905,6 +1906,10 @@ function wp_list_comments( $args = array(), $comments = null ) { * @type string $title_reply The translatable 'reply' button label. Default 'Leave a Reply'. * @type string $title_reply_to The translatable 'reply-to' button label. Default 'Leave a Reply to %s', * where %s is the author of the comment being replied to. + * @type string $title_reply_before HTML displayed before the comment form title. + * Default: '

'. + * @type string $title_reply_after HTML displayed after the comment form title. + * Default: '

'. * @type string $cancel_reply_link The translatable 'cancel reply' button label. Default 'Cancel reply'. * @type string $label_submit The translatable 'submit' button label. Default 'Post a comment'. * @type string $submit_button HTML format for the Submit button. @@ -1966,6 +1971,8 @@ function comment_form( $args = array(), $post_id = null ) { 'name_submit' => 'submit', 'title_reply' => __( 'Leave a Reply' ), 'title_reply_to' => __( 'Leave a Reply to %s' ), + 'title_reply_before' => '

', + 'title_reply_after' => '

', 'cancel_reply_link' => __( 'Cancel reply' ), 'label_submit' => __( 'Post Comment' ), 'submit_button' => '', @@ -1997,7 +2004,20 @@ function comment_form( $args = array(), $post_id = null ) { do_action( 'comment_form_before' ); ?>
-

+ '; + + cancel_comment_reply_link( $args['cancel_reply_link'] ); + + echo ''; + + echo $args['title_reply_after']; + ?> +