apply_filters( 'get_comment_date', string|int $date, string $d, WP_Comment $comment )

Filters the returned comment date.

Description Description

Parameters Parameters


(string|int) Formatted date string or Unix timestamp.


(string) The format of the date.


(WP_Comment) The comment object.

Top ↑

Source Source

File: wp-includes/comment-template.php

View on Trac

Top ↑

Changelog Changelog

Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Nick Cernis

    An example of filtering the comment date format:

    function custom_comment_date( $date, $d, $comment ) {
    	return mysql2date( 'F jS, Y', $comment->comment_date );
    add_filter( 'get_comment_date', 'custom_comment_date', 10, 3);

    Use the standard PHP date format characters:

You must log in before being able to contribute a note or feedback.