get_comment_date
Filter HookDescription
Filters the returned comment date.Hook Information
File Location |
wp-includes/comment-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 629 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|int
|
$comment_date
|
Formatted date string or Unix timestamp. |
string
|
$format
|
PHP date format. |
WP_Comment
|
$comment
|
The comment object. |
Usage Examples
Basic Usage
<?php
// Hook into get_comment_date
add_filter('get_comment_date', 'my_custom_filter', 10, 3);
function my_custom_filter($comment_date, $format, $comment) {
// Your custom filtering logic here
return $comment_date;
}
Source Code Context
wp-includes/comment-template.php:629
- How this hook is used in WordPress core
<?php
624 *
625 * @param string|int $comment_date Formatted date string or Unix timestamp.
626 * @param string $format PHP date format.
627 * @param WP_Comment $comment The comment object.
628 */
629 return apply_filters( 'get_comment_date', $comment_date, $format, $comment );
630 }
631
632 /**
633 * Displays the comment date of the current comment.
634 *
PHP Documentation
<?php
/**
* Filters the returned comment date.
*
* @since 1.5.0
*
* @param string|int $comment_date Formatted date string or Unix timestamp.
* @param string $format PHP date format.
* @param WP_Comment $comment The comment object.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/comment-template.php
Related Hooks
Related hooks will be displayed here in future updates.