Skip to content

Commit 3edcdb2

Browse files
authored
Merge pull request #516 from GatherPress/GP-507-revert
Reverting 507, issue with caching not allowing the change of datetime…
2 parents 93dbb8f + 7d71859 commit 3edcdb2

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

includes/core/classes/class-event.php

-9
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,6 @@ protected function get_formatted_datetime(
408408
string $which = 'start',
409409
bool $local = true
410410
): string {
411-
$cache_key = 'formatted_datetime_' . md5( $format . $which . ( $local ? 'local' : 'gmt' ) );
412-
$cached_date = get_transient( $cache_key );
413-
414-
if ( false !== $cached_date ) {
415-
return $cached_date;
416-
}
417-
418411
$dt = $this->get_datetime();
419412
$date = $dt[ sprintf( 'datetime_%s_gmt', $which ) ];
420413
$dt['timezone'] = static::maybe_convert_offset( $dt['timezone'] );
@@ -435,8 +428,6 @@ protected function get_formatted_datetime(
435428
$date = wp_date( $format, $ts, $tz );
436429
}
437430

438-
set_transient( $cache_key, $date, HOUR_IN_SECONDS * 12 );
439-
440431
return (string) $date;
441432
}
442433

0 commit comments

Comments
 (0)