Make WordPress Core

Ticket #53294: functions.diff

File functions.diff, 883 bytes (added by wpvar, 3 years ago)

Patch

  • wp-includes/functions.php

    diff --git a/wp-includes/functions.php b/wp-includes/functions.php
    index 043491e310..245fdb2350 100644
    a b function current_time( $type, $gmt = 0 ) { 
    8080
    8181        $timezone = $gmt ? new DateTimeZone( 'UTC' ) : wp_timezone();
    8282        $datetime = new DateTime( 'now', $timezone );
     83        $datetime = $datetime->format( $type );
    8384
    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;
    8598}
    8699
    87100/**