Changeset 45914 for trunk/src/wp-includes/functions.php
- Timestamp:
- 08/29/2019 11:17:30 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r45909 r45914 164 164 */ 165 165 function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { 166 $timestamp = $timestamp_with_offset; 167 166 168 // If timestamp is omitted it should be current time (summed with offset, unless `$gmt` is true). 167 $timestamp = $timestamp_with_offset ? $timestamp_with_offset : current_time( 'timestamp', $gmt ); 169 if ( ! is_numeric( $timestamp ) ) { 170 $timestamp = current_time( 'timestamp', $gmt ); 171 } 168 172 169 173 /* … … 219 223 * @param DateTimeZone $timezone Optional. Timezone to output result in. Defaults to timezone 220 224 * from site settings. 221 * @return string The date, translated if locale specifies it.225 * @return string|false The date, translated if locale specifies it. False on invalid timestamp input. 222 226 */ 223 227 function wp_date( $format, $timestamp = null, $timezone = null ) { 224 228 global $wp_locale; 225 229 226 if ( !$timestamp ) {230 if ( null === $timestamp ) { 227 231 $timestamp = time(); 232 } elseif ( ! is_numeric( $timestamp ) ) { 233 return false; 228 234 } 229 235
Note: See TracChangeset
for help on using the changeset viewer.