Skip to content

Commit

Permalink
Reverting 507, issue with caching not allowing the change of datetime…
Browse files Browse the repository at this point in the history
… and remaining cached.
  • Loading branch information
mauteri committed Jan 27, 2024
1 parent 93dbb8f commit 7d71859
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions includes/core/classes/class-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,6 @@ protected function get_formatted_datetime(
string $which = 'start',
bool $local = true
): string {
$cache_key = 'formatted_datetime_' . md5( $format . $which . ( $local ? 'local' : 'gmt' ) );
$cached_date = get_transient( $cache_key );

if ( false !== $cached_date ) {
return $cached_date;
}

$dt = $this->get_datetime();
$date = $dt[ sprintf( 'datetime_%s_gmt', $which ) ];
$dt['timezone'] = static::maybe_convert_offset( $dt['timezone'] );
Expand All @@ -435,8 +428,6 @@ protected function get_formatted_datetime(
$date = wp_date( $format, $ts, $tz );
}

set_transient( $cache_key, $date, HOUR_IN_SECONDS * 12 );

return (string) $date;
}

Expand Down

0 comments on commit 7d71859

Please sign in to comment.