Make WordPress Core


Ignore:
Timestamp:
02/21/2023 03:26:10 PM (17 months ago)
Author:
hellofromTonya
Message:

Comments: Restore global $comment assignment in comment_form_title().

Restores the global $comment assignment in comment_form_title(), which was mistakely removed in [55369].

As noted in the function's DocBlock:

@internal The $comment global must be present to allow template tags access to the current comment. See https://core.trac.wordpress.org/changeset/36512.

Follow-up to [55369].

Props hellofromTonya, costdev.
Fixes #53962.

File:
1 edited

Legend:

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

    r55369 r55395  
    20352035 * @since 6.2.0 Added the `$post` parameter.
    20362036 *
     2037 * @global WP_Comment $comment Global comment object.
     2038 *
    20372039 * @param string|false      $no_reply_text  Optional. Text to display when not replying to a comment.
    20382040 *                                          Default false.
     
    20462048 */
    20472049function comment_form_title( $no_reply_text = false, $reply_text = false, $link_to_parent = true, $post = null ) {
     2050    global $comment;
     2051
    20482052    if ( false === $no_reply_text ) {
    20492053        $no_reply_text = __( 'Leave a Reply' );
     
    20672071        return;
    20682072    }
     2073
     2074    // Sets the global so that template tags can be used in the comment form.
     2075    $comment = get_comment( $reply_to_id );
    20692076
    20702077    if ( $link_to_parent ) {
Note: See TracChangeset for help on using the changeset viewer.