diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index ec6cc616dc..ec248f5b98 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -70,12 +70,12 @@ function mysql2date( $format, $date, $translate = true ) { * @since 1.0.0 * @since 5.3.0 Now returns an integer if `$type` is 'U'. Previously a string was returned. * - * @param string $type Type of time to retrieve. Accepts 'mysql', 'timestamp', 'U', - * or PHP date format string (e.g. 'Y-m-d'). - * @param int|bool $gmt Optional. Whether to use GMT timezone. Default false. + * @param string $type Type of time to retrieve. Accepts 'mysql', 'timestamp', 'U', + * or PHP date format string (e.g. 'Y-m-d'). + * @param bool $gmt Optional. Whether to use GMT timezone. Default false. * @return int|string Integer if `$type` is 'timestamp' or 'U', string otherwise. */ -function current_time( $type, $gmt = 0 ) { +function current_time( $type, $gmt = false ) { // Don't use non-GMT timestamp, unless you know the difference and really need to. if ( 'timestamp' === $type || 'U' === $type ) { return $gmt ? time() : time() + (int) ( (float) get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); @@ -216,7 +216,6 @@ function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { * @param int $timestamp A sum of Unix timestamp and timezone offset in seconds. * Might be without offset if input omitted timestamp but requested GMT. * @param bool $gmt Whether to use GMT timezone. Only applies if timestamp was not provided. - * Default false. */ $date = apply_filters( 'date_i18n', $date, $format, $timestamp, $gmt ); @@ -235,10 +234,10 @@ function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { * * @global WP_Locale $wp_locale WordPress date and time locale object. * - * @param string $format PHP date format. - * @param int $timestamp Optional. Unix timestamp. Defaults to current time. - * @param DateTimeZone $timezone Optional. Timezone to output result in. Defaults to timezone - * from site settings. + * @param string $format PHP date format. + * @param int|null $timestamp Optional. Unix timestamp. Defaults to current time. + * @param DateTimeZone|null $timezone Optional. Timezone to output result in. Defaults to timezone + * from site settings. * @return string|false The date, translated if locale specifies it. False on invalid timestamp input. */ function wp_date( $format, $timestamp = null, $timezone = null ) {