get_the_date
Filters the date of the post.
Использование
add_filter( 'get_the_date', 'wp_kama_get_the_date_filter', 10, 3 );
/**
* Function for `get_the_date` filter-hook.
*
* @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.
*
* @return string|int
*/
function wp_kama_get_the_date_filter( $the_date, $format, $post ){
// filter...
return $the_date;
}
- $the_date(строка|int)
- Formatted date string or Unix timestamp if
$formatis 'U' or 'G'. - $format(строка)
- PHP date format.
- $post(WP_Post)
- The post object.
Список изменений
| С версии 3.0.0 | Введена. |
Где вызывается хук
get_the_date
wp-includes/general-template.php 2747
return apply_filters( 'get_the_date', $the_date, $format, $post );