wp_date
Filter HookDescription
Filters the date formatted based on the locale.Hook Information
File Location |
wp-includes/functions.php
View on GitHub
|
Hook Type | Filter |
Line Number | 319 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$date
|
Formatted date string. |
string
|
$format
|
Format to display the date. |
int
|
$timestamp
|
Unix timestamp. |
DateTimeZone
|
$timezone
|
Timezone. |
Usage Examples
Basic Usage
<?php
// Hook into wp_date
add_filter('wp_date', 'my_custom_filter', 10, 4);
function my_custom_filter($date, $format, $timestamp, $timezone) {
// Your custom filtering logic here
return $date;
}
Source Code Context
wp-includes/functions.php:319
- How this hook is used in WordPress core
<?php
314 * @param string $date Formatted date string.
315 * @param string $format Format to display the date.
316 * @param int $timestamp Unix timestamp.
317 * @param DateTimeZone $timezone Timezone.
318 */
319 $date = apply_filters( 'wp_date', $date, $format, $timestamp, $timezone );
320
321 return $date;
322 }
323
324 /**
PHP Documentation
<?php
/**
* Filters the date formatted based on the locale.
*
* @since 5.3.0
*
* @param string $date Formatted date string.
* @param string $format Format to display the date.
* @param int $timestamp Unix timestamp.
* @param DateTimeZone $timezone Timezone.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/functions.php
Related Hooks
Related hooks will be displayed here in future updates.