date_i18n
Filters the date formatted based on the locale.
Usage
add_filter( 'date_i18n', 'wp_kama_date_i18n_filter', 10, 4 ); /** * Function for `date_i18n` filter-hook. * * @param string $date Formatted date string. * @param string $format Format to display the date. * @param int $timestamp A sum of Unix timestamp and timezone offset in seconds. Might be without offset if input omitted timestamp but requested GMT. * @param bool $gmt Whether to use GMT timezone. Only applies if timestamp was not provided. * * @return string */ function wp_kama_date_i18n_filter( $date, $format, $timestamp, $gmt ){ // filter... return $date; }
- $date(string)
- Formatted date string.
- $format(string)
- Format to display the date.
- $timestamp(int)
- A sum of Unix timestamp and timezone offset in seconds. Might be without offset if input omitted timestamp but requested GMT.
- $gmt(true|false)
- Whether to use GMT timezone. Only applies if timestamp was not provided.
Default: false
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
date_i18n
wp-includes/functions.php 216
$date = apply_filters( 'date_i18n', $date, $format, $timestamp, $gmt );