get_the_date
Filter HookDescription
Filters the date of the post.Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2731 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|int
|
$the_date
|
Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. |
string
|
$format
|
PHP date format. |
WP_Post
|
$post
|
The post object. |
Usage Examples
Basic Usage
<?php
// Hook into get_the_date
add_filter('get_the_date', 'my_custom_filter', 10, 3);
function my_custom_filter($the_date, $format, $post) {
// Your custom filtering logic here
return $the_date;
}
Source Code Context
wp-includes/general-template.php:2731
- How this hook is used in WordPress core
<?php
2726 *
2727 * @param string|int $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
2728 * @param string $format PHP date format.
2729 * @param WP_Post $post The post object.
2730 */
2731 return apply_filters( 'get_the_date', $the_date, $format, $post );
2732 }
2733
2734 /**
2735 * Displays the date on which the post was last modified.
2736 *
PHP Documentation
<?php
/**
* Filters the date of the post.
*
* @since 3.0.0
*
* @param string|int $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
* @param string $format PHP date format.
* @param WP_Post $post The post object.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.