#21184 closed defect (bug) (fixed)

$comment global var is not set when wp_list_comments is called with callback function

Reported by: sirzooro Owned by: ryan
Priority: normal Milestone: 3.5
Component: Comments Version: 2.7
Severity: normal Keywords: has-patch
Cc:

Description

Many comments-related functions (mainly template ones) uses comment object stored in global variable $comment, when they are called without parameters. However when you try to use wp_list_comments() with custom callback function, this is not true. Currently template authors have to either set this global var in their callback functions, or explicitly pass comment object to functions like comment_text(). Attached path fixes this.

Attachments (1)

comment-template.php.diff (555 bytes) - added by sirzooro 11 months ago.

Download all attachments as: .zip

Change History (3)

  • Milestone changed from Awaiting Review to 3.5
  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [21324]:

Set the global comment var before invoking callbacks in wp_list_comments(). Props sirzooro. fixes #21184

Note: See TracTickets for help on using tickets.