Opened 23 months ago
Pass $comment_date to get_comment_time filter
|Reported by:||lexhair||Owned by:|
I was writing a function to customize the formatted time to include the timezone in the comment meta data using the get_comment_time filter. In order for me to properly indicate whether daylight savings time was in effect at the time of the comment, I needed to globalize $comment to get the comment_time property. The filter passed the $date variable which is the formatted time part of the timestamp but not the $comment_date variable which contained the entire timestamp from $comment. In the function I developed, the $date string wasn't used at all. I returned the formatted time string from $comment->comment_date directly.
Since get_comment_time() already establishes $comment_date, why not pass it to the filter as well?