Cache issues with translation/translatepress
-
Hello,
I had a bunch of cache issues (events showing up in listings in different languages, regardless of the current language set with TranslatePress), until I’ve done the following changes:
common/src/Tribe/Models/Post_Types/Base.php:
in get_properties_cache_key:public function get_properties_cache_key( string $filter ): string { $lang = get_bloginfo("language"); return $this->get_cache_slug() . '_' . $this->post->ID . '_' . $filter . '_' . $lang; }and in src/functions/template-tags/event.php:
// Build a memoization cache key salted by the request parameters. $key_fields = [ $cache_post->ID, $cache_post->post_modified, // Use thepost_passwordfield as we show/hide some information depending on that. $cache_post->post_password, // We must include options on cache key, because options influence the hydrated data on the Event object. Tribe__Settings_Manager::get_options(), $cache['option_start_of_week'], $cache['option_timezone_string'], $cache['option_gmt_offset'], $output, $filter, get_bloginfo("language"), ];Any chance you can get these changes in the next release please ?
Thank you !
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Cache issues with translation/translatepress’ is closed to new replies.