mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@55395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
910a76f5c2
commit
64466d3c35
@ -2034,6 +2034,8 @@ function comment_id_fields( $post = null ) {
|
||||
* @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.
|
||||
@ -2045,6 +2047,8 @@ function comment_id_fields( $post = null ) {
|
||||
* 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' );
|
||||
}
|
||||
@ -2067,6 +2071,9 @@ function comment_form_title( $no_reply_text = false, $reply_text = false, $link_
|
||||
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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user