WordPress.org

Make WordPress Core

Changeset 34308


Ignore:
Timestamp:
09/18/2015 07:17:19 PM (4 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r34270 r34308  
    18821882 * @since 4.1.0 Introduced the 'class_submit' argument.
    18831883 * @since 4.2.0 Introduced 'submit_button' and 'submit_fields' arguments.
     1884 * @since 4.4.0 Introduced 'title_reply_before' and 'title_reply_after' arguments.
    18841885 *
    18851886 * @param array       $args {
     
    19061907 *     @type string $title_reply_to       The translatable 'reply-to' button label. Default 'Leave a Reply to %s',
    19071908 *                                        where %s is the author of the comment being replied to.
     1909 *     @type string $title_reply_before   HTML displayed before the comment form title.
     1910 *                                        Default: '<h3 id="reply-title" class="comment-reply-title">'.
     1911 *     @type string $title_reply_after    HTML displayed after the comment form title.
     1912 *                                        Default: '</h3>'.
    19081913 *     @type string $cancel_reply_link    The translatable 'cancel reply' button label. Default 'Cancel reply'.
    19091914 *     @type string $label_submit         The translatable 'submit' button label. Default 'Post a comment'.
     
    19671972        'title_reply'          => __( 'Leave a Reply' ),
    19681973        'title_reply_to'       => __( 'Leave a Reply to %s' ),
     1974        'title_reply_before'   => '<h3 id="reply-title" class="comment-reply-title">',
     1975        'title_reply_after'    => '</h3>',
    19691976        'cancel_reply_link'    => __( 'Cancel reply' ),
    19701977        'label_submit'         => __( 'Post Comment' ),
     
    19982005            ?>
    19992006            <div id="respond" class="comment-respond">
    2000                 <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3>
     2007                <?php
     2008                echo $args['title_reply_before'];
     2009
     2010                comment_form_title( $args['title_reply'], $args['title_reply_to'] );
     2011
     2012                echo ' <small>';
     2013
     2014                cancel_comment_reply_link( $args['cancel_reply_link'] );
     2015
     2016                echo '</small>';
     2017
     2018                echo $args['title_reply_after'];
     2019                ?>
     2020
    20012021                <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
    20022022                    <?php echo $args['must_log_in']; ?>
Note: See TracChangeset for help on using the changeset viewer.