From 16848d5468e380e8c4ec431ee4a19d21b7976376 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 5 Aug 2021 14:48:11 +0000 Subject: [PATCH] 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 --- src/wp-includes/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 55282b18df..2b75cfea03 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -167,6 +167,7 @@ function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { // If timestamp is omitted it should be current time (summed with offset, unless `$gmt` is true). if ( ! is_numeric( $timestamp ) ) { + // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested $timestamp = current_time( 'timestamp', $gmt ); }