From 1877b8c726723ba6400782cd346178b5be5130ad Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 12 Feb 2016 04:10:25 +0000 Subject: [PATCH] Set the `$comment` global in `comment_form_title()`. In [33963], `comment_form_title()` was refactored so that it no longer made reference to the `$comment` global. This broke some functionality within the comment form, as certain template would no longer be able to access the "current" comment. Props d4z_c0nf, WisdmLabs, boonebgorges. Fixes #35624. Built from https://develop.svn.wordpress.org/trunk@36512 git-svn-id: http://core.svn.wordpress.org/trunk@36479 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 29625d5300..998a20e80f 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1817,7 +1817,7 @@ function comment_id_fields( $id = 0 ) { * to their comment. Default true. */ function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) { - $comment = get_comment(); + global $comment; if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' ); @@ -1827,6 +1827,7 @@ function comment_form_title( $noreplytext = false, $replytext = false, $linktopa 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 ) ? '' . get_comment_author( $comment ) . '' : get_comment_author( $comment ); printf( $replytext, $author ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 88f4904a2f..a6508c3ae9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36511'; +$wp_version = '4.5-alpha-36512'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.