Pass $comment_date to get_comment_time filter
|Reported by:||lexhair||Owned by:||nacin|
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?
Change History (7)
comment:4 SergeyBiryukov — 8 weeks ago
- Component changed from Date/Time to Comments
- Milestone changed from Awaiting Review to 3.9
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed