diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 043491e310..245fdb2350 100644
a
|
b
|
function current_time( $type, $gmt = 0 ) { |
80 | 80 | |
81 | 81 | $timezone = $gmt ? new DateTimeZone( 'UTC' ) : wp_timezone(); |
82 | 82 | $datetime = new DateTime( 'now', $timezone ); |
| 83 | $datetime = $datetime->format( $type ); |
83 | 84 | |
84 | | return $datetime->format( $type ); |
| 85 | /** |
| 86 | * Filters current datetime based on the type. |
| 87 | * |
| 88 | * @since 5.8.0 |
| 89 | * |
| 90 | * @param int|string $datetime Integer if $type is 'timestamp', string otherwise. |
| 91 | * @param int $type Type of time to retrieve. |
| 92 | * @param int|bool $gmt Whether to use GMT timezone. |
| 93 | * @param DateTimeZone $timezone Timezone. |
| 94 | */ |
| 95 | $datetime = apply_filters( 'current_time', $datetime, $type, $gmt, $timezone ); |
| 96 | |
| 97 | return $datetime; |
85 | 98 | } |
86 | 99 | |
87 | 100 | /** |