Skip to content

Commit 16848d5

Browse files
Coding Standards: Silence a WPCS warning in date_i18n().
This fixes a "Calling `current_time()` with a `$type` of `timestamp` or `U` is strongly discouraged as it will not return a Unix (UTC) timestamp" warning. Props jrf. See #53359. git-svn-id: https://develop.svn.wordpress.org/trunk@51557 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a6bb6ef commit 16848d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/wp-includes/functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) {
167167

168168
// If timestamp is omitted it should be current time (summed with offset, unless `$gmt` is true).
169169
if ( ! is_numeric( $timestamp ) ) {
170+
// phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested
170171
$timestamp = current_time( 'timestamp', $gmt );
171172
}
172173

0 commit comments

Comments
 (0)