Skip to content

Commit

Permalink
Fix caching check.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauteri committed Jan 28, 2024
1 parent 88661a8 commit 6ff8671
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/core/classes/class-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ public function get_datetime(): array {
}

$cache_key = sprintf( self::DATETIME_CACHE_KEY, $this->event->ID );
$data = wp_cache_get( $cache_key ) ?? $this->datetimes;
$cache = wp_cache_get( $cache_key );
$data = ! empty( $cache ) ? $cache : $this->datetimes;

if ( empty( $data ) || ! is_array( $data ) ) {
$table = sprintf( static::TABLE_FORMAT, $wpdb->prefix );
Expand Down

0 comments on commit 6ff8671

Please sign in to comment.