comment_form_title

The timeline below displays how wordpress function comment_form_title has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Displays text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 * @since 6.2.0 Added the `$post` parameter.
 *
 * @global WP_Comment $comment Global comment object.
 *
 * @param string|false      $no_reply_text  Optional. Text to display when not replying to a comment.
 *                                          Default false.
 * @param string|false      $reply_text     Optional. Text to display when replying to a comment.
 *                                          Default false. Accepts "%s" for the author of the comment
 *                                          being replied to.
 * @param bool              $link_to_parent Optional. Boolean to control making the author's name a link
 *                                          to their comment. Default true.
 * @param int|WP_Post|null  $post           Optional. The post that the comment form is being displayed for.
 *                                          Defaults to the current global post.
 */
function comment_form_title($no_reply_text = false, $reply_text = false, $link_to_parent = true, $post = null)
{
    global $comment;
    if (false === $no_reply_text) {
        $no_reply_text = __('Leave a Reply');
    }
    if (false === $reply_text) {
        /* translators: %s: Author of the comment being replied to. */
        $reply_text = __('Leave a Reply to %s');
    }
    $post = get_post($post);
    if (!$post) {
        echo $no_reply_text;
        return;
    }
    $reply_to_id = _get_comment_reply_id($post->ID);
    if (0 === $reply_to_id) {
        echo $no_reply_text;
        return;
    }
    // Sets the global so that template tags can be used in the comment form.
    $comment = get_comment($reply_to_id);
    if ($link_to_parent) {
        $comment_author = sprintf('<a href="#comment-%1$s">%2$s</a>', get_comment_ID(), get_comment_author($reply_to_id));
    } else {
        $comment_author = get_comment_author($reply_to_id);
    }
    printf($reply_text, $comment_author);
}

WordPress Version: 6.2

/**
 * Displays text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 * @since 6.2.0 Added the `$post` parameter.
 *
 * @global WP_Comment $comment Global comment object.
 *
 * @param string|false      $no_reply_text  Optional. Text to display when not replying to a comment.
 *                                          Default false.
 * @param string|false      $reply_text     Optional. Text to display when replying to a comment.
 *                                          Default false. Accepts "%s" for the author of the comment
 *                                          being replied to.
 * @param bool              $link_to_parent Optional. Boolean to control making the author's name a link
 *                                          to their comment. Default true.
 * @param int|WP_Post|null  $post           Optional. The post that the comment form is being displayed for.
 *                                          Defaults to the current global post.
 */
function comment_form_title($no_reply_text = false, $reply_text = false, $link_to_parent = true, $post = null)
{
    global $comment;
    if (false === $no_reply_text) {
        $no_reply_text = __('Leave a Reply');
    }
    if (false === $reply_text) {
        /* translators: %s: Author of the comment being replied to. */
        $reply_text = __('Leave a Reply to %s');
    }
    $post = get_post($post);
    if (!$post) {
        echo $no_reply_text;
        return;
    }
    $reply_to_id = _get_comment_reply_id($post->ID);
    if (0 === $reply_to_id) {
        echo $no_reply_text;
        return;
    }
    // Sets the global so that template tags can be used in the comment form.
    $comment = get_comment($reply_to_id);
    if ($link_to_parent) {
        $author = '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($reply_to_id) . '</a>';
    } else {
        $author = get_comment_author($reply_to_id);
    }
    printf($reply_text, $author);
}

WordPress Version: 5.7

/**
 * Displays text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 *
 * @global WP_Comment $comment Global comment object.
 *
 * @param string|false $no_reply_text  Optional. Text to display when not replying to a comment.
 *                                     Default false.
 * @param string|false $reply_text     Optional. Text to display when replying to a comment.
 *                                     Default false. Accepts "%s" for the author of the comment
 *                                     being replied to.
 * @param bool         $link_to_parent Optional. Boolean to control making the author's name a link
 *                                     to their comment. Default true.
 */
function comment_form_title($no_reply_text = false, $reply_text = false, $link_to_parent = true)
{
    global $comment;
    if (false === $no_reply_text) {
        $no_reply_text = __('Leave a Reply');
    }
    if (false === $reply_text) {
        /* translators: %s: Author of the comment being replied to. */
        $reply_text = __('Leave a Reply to %s');
    }
    $reply_to_id = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $reply_to_id) {
        echo $no_reply_text;
    } else {
        // Sets the global so that template tags can be used in the comment form.
        $comment = get_comment($reply_to_id);
        if ($link_to_parent) {
            $author = '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($comment) . '</a>';
        } else {
            $author = get_comment_author($comment);
        }
        printf($reply_text, $author);
    }
}

WordPress Version: 5.5

/**
 * Displays text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 *
 * @global WP_Comment $comment Global comment object.
 *
 * @param string $no_reply_text  Optional. Text to display when not replying to a comment.
 *                               Default false.
 * @param string $reply_text     Optional. Text to display when replying to a comment.
 *                               Default false. Accepts "%s" for the author of the comment
 *                               being replied to.
 * @param string $link_to_parent Optional. Boolean to control making the author's name a link
 *                               to their comment. Default true.
 */
function comment_form_title($no_reply_text = false, $reply_text = false, $link_to_parent = true)
{
    global $comment;
    if (false === $no_reply_text) {
        $no_reply_text = __('Leave a Reply');
    }
    if (false === $reply_text) {
        /* translators: %s: Author of the comment being replied to. */
        $reply_text = __('Leave a Reply to %s');
    }
    $reply_to_id = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $reply_to_id) {
        echo $no_reply_text;
    } else {
        // Sets the global so that template tags can be used in the comment form.
        $comment = get_comment($reply_to_id);
        if ($link_to_parent) {
            $author = '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($comment) . '</a>';
        } else {
            $author = get_comment_author($comment);
        }
        printf($reply_text, $author);
    }
}

WordPress Version: 5.4

/**
 * Displays text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 *
 * @global WP_Comment $comment Global comment object.
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        /* translators: %s: Author of the comment being replied to. */
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        // Sets the global so that template tags can be used in the comment form.
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($comment) . '</a>' : get_comment_author($comment);
        printf($replytext, $author);
    }
}

WordPress Version: 5.3

/**
 * Display text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 *
 * @global WP_Comment $comment Global comment object.
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        /* translators: %s: Author of the comment being replied to. */
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        // Sets the global so that template tags can be used in the comment form.
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($comment) . '</a>' : get_comment_author($comment);
        printf($replytext, $author);
    }
}

WordPress Version: 4.5

/**
 * Display text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @internal The $comment global must be present to allow template tags access to the current
 *           comment. See https://core.trac.wordpress.org/changeset/36512.
 *
 * @since 2.7.0
 *
 * @global WP_Comment $comment Current comment.
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        // Sets the global so that template tags can be used in the comment form.
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($comment) . '</a>' : get_comment_author($comment);
        printf($replytext, $author);
    }
}

WordPress Version: 4.4

/**
 * Display text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @since 2.7.0
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    $comment = get_comment();
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author($comment) . '</a>' : get_comment_author($comment);
        printf($replytext, $author);
    }
}

WordPress Version: 4.3

/**
 * Display text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @since 2.7.0
 *
 * @global object $comment
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
        printf($replytext, $author);
    }
}

WordPress Version: 4.1

/**
 * Display text based on comment reply status.
 *
 * Only affects users with JavaScript disabled.
 *
 * @since 2.7.0
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
        printf($replytext, $author);
    }
}

WordPress Version: 3.9

/**
 * Display text based on comment reply status.
 *
 * Only affects users with Javascript disabled.
 *
 * @since 2.7.0
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
 *                             Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment
 *                             being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link
 *                             to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
        printf($replytext, $author);
    }
}

WordPress Version: 3.7

/**
 * Display text based on comment reply status.
 *
 * Only affects users with Javascript disabled.
 *
 * @since 2.7.0
 *
 * @param string $noreplytext  Optional. Text to display when not replying to a comment. Default false.
 * @param string $replytext    Optional. Text to display when replying to a comment.
 *                             Default false. Accepts "%s" for the author of the comment being replied to.
 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. Default true.
 */
function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true)
{
    global $comment;
    if (false === $noreplytext) {
        $noreplytext = __('Leave a Reply');
    }
    if (false === $replytext) {
        $replytext = __('Leave a Reply to %s');
    }
    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    if (0 == $replytoid) {
        echo $noreplytext;
    } else {
        $comment = get_comment($replytoid);
        $author = $linktoparent ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
        printf($replytext, $author);
    }
}