date_i18n

Filters the date formatted based on the locale.

Description

apply_filters( 'date_i18n', (string) $j, (string) $req_format, (int) $i, (bool) $gmt ); 

Parameters (4)

0. $j (string)
Formatted date string.
1. $req_format (string)
Format to display the date.
2. $i (int)
Unix timestamp.
3. $gmt (bool)
Whether to convert to GMT for time. Default false.

Usage

To run the hook, copy the example below.
  1. $j = apply_filters( 'date_i18n', $j, $req_format, $i, $gmt ); 
  2.  
  3. if ( !empty( $j ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the date_i18n callback 
  2. function filter_date_i18n( $j, $req_format, $i, $gmt ) { 
  3. // make filter magic happen here... 
  4. return $j
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'date_i18n', 'filter_date_i18n', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'date_i18n', 'filter_date_i18n', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/functions.php  
  1. $j = apply_filters( 'date_i18n', $j, $req_format, $i, $gmt );