The Events Calendar - Version 6.0.3.1

Version Description

= [6.0] = Please see the changelog for the complete list of changes in this release. Previous versions of The Events Calendar are not cross-compatible with 6.X add-ons. Remember to always make a backup of your database and files before updating!

Download this release

Release Info

Developer Camwynsp
Plugin Icon The Events Calendar
Version 6.0.3.1
Comparing to
See all releases

Code changes from version 6.0.3 to 6.0.3.1

Files changed (35) hide show
  1. common/src/Tribe/Cache_Listener.php +1 -0
  2. common/src/Tribe/Main.php +1 -1
  3. common/src/Tribe/Models/Post_Types/Base.php +198 -35
  4. common/src/Tribe/Models/Post_Types/Nothing.php +1 -1
  5. common/vendor/autoload.php +1 -1
  6. common/vendor/autoload_52.php +1 -1
  7. common/vendor/composer/autoload_real.php +4 -4
  8. common/vendor/composer/autoload_real_52.php +3 -3
  9. common/vendor/composer/autoload_static.php +5 -5
  10. lang/the-events-calendar-de_CH.mo +0 -0
  11. lang/the-events-calendar-de_CH_informal.mo +0 -0
  12. lang/the-events-calendar-de_DE.mo +0 -0
  13. lang/the-events-calendar-de_DE_formal.mo +0 -0
  14. lang/the-events-calendar-fr_FR.mo +0 -0
  15. lang/the-events-calendar-gl_ES.mo +0 -0
  16. lang/the-events-calendar-it_IT.mo +0 -0
  17. readme.txt +9 -2
  18. src/Events/Custom_Tables/V1/Integrations/Dot_Com/Clear_Event_Cache.php +1 -1
  19. src/Events/Custom_Tables/V1/Integrations/Provider.php +5 -0
  20. src/Events/Custom_Tables/V1/Integrations/WP_Engine/Clear_Event_Cache.php +68 -0
  21. src/Events/Custom_Tables/V1/Integrations/WP_Engine/Provider.php +56 -0
  22. src/Events/Custom_Tables/V1/WP_Query/Custom_Tables_Query.php +2 -1
  23. src/Tribe/Collections/Lazy_Post_Collection.php +3 -1
  24. src/Tribe/Main.php +1 -1
  25. src/Tribe/Models/Post_Types/Event.php +57 -0
  26. src/Tribe/Updater.php +1 -0
  27. src/Tribe/Views/V2/Template_Bootstrap.php +1 -1
  28. src/functions/template-tags/event.php +15 -30
  29. src/functions/template-tags/organizer.php +29 -12
  30. src/functions/template-tags/venue.php +29 -11
  31. the-events-calendar.php +1 -1
  32. vendor/autoload.php +1 -1
  33. vendor/composer/autoload_classmap.php +2 -0
  34. vendor/composer/autoload_real.php +4 -4
  35. vendor/composer/autoload_static.php +6 -4
common/src/Tribe/Cache_Listener.php CHANGED
@@ -62,6 +62,7 @@ class Tribe__Cache_Listener {
62
  add_action( 'updated_option', [ $this, 'update_last_updated_option' ], 10, 3 );
63
  add_action( 'updated_option', [ $this, 'update_last_save_post' ], 10, 3 );
64
  add_action( 'generate_rewrite_rules', [ $this, 'generate_rewrite_rules' ] );
 
65
  }
66
 
67
  /**
62
  add_action( 'updated_option', [ $this, 'update_last_updated_option' ], 10, 3 );
63
  add_action( 'updated_option', [ $this, 'update_last_save_post' ], 10, 3 );
64
  add_action( 'generate_rewrite_rules', [ $this, 'generate_rewrite_rules' ] );
65
+ add_action( 'clean_post_cache', [ $this, 'save_post' ], 0, 2 );
66
  }
67
 
68
  /**
common/src/Tribe/Main.php CHANGED
@@ -21,7 +21,7 @@ class Tribe__Main {
21
  const OPTIONNAME = 'tribe_events_calendar_options';
22
  const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options';
23
 
24
- const VERSION = '5.0.2';
25
 
26
  const FEED_URL = 'https://theeventscalendar.com/feed/';
27
 
21
  const OPTIONNAME = 'tribe_events_calendar_options';
22
  const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options';
23
 
24
+ const VERSION = '5.0.2.1';
25
 
26
  const FEED_URL = 'https://theeventscalendar.com/feed/';
27
 
common/src/Tribe/Models/Post_Types/Base.php CHANGED
@@ -21,6 +21,13 @@ use Tribe__Cache_Listener as Cache_Listener;
21
  * @package Tribe\Models\Post_Types
22
  */
23
  abstract class Base {
 
 
 
 
 
 
 
24
  /**
25
  * The post object base for this post type instance.
26
  *
@@ -78,7 +85,7 @@ abstract class Base {
78
  }
79
 
80
  // Cache by post ID and filter.
81
- $cache_key = $cache_slug . '_' . $this->post->ID . '_' . $filter;
82
 
83
  return ( new Cache() )->get( $cache_key, Cache_Listener::TRIGGER_SAVE_POST );
84
  }
@@ -102,14 +109,52 @@ abstract class Base {
102
  * @since 4.9.18
103
  *
104
  * @param string $filter The type of filter to get the properties for.
 
105
  *
106
  * @return array The model properties. This value might be cached.
107
  */
108
- protected function get_properties( $filter ) {
109
- $cached = $this->get_cached_properties( $filter);
110
 
111
  if ( false !== $cached ) {
112
- return $cached;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
 
115
  $props = $this->build_properties( $filter );
@@ -134,33 +179,34 @@ abstract class Base {
134
  * Returns the WP_Post version of this model.
135
  *
136
  * @since 4.9.18
 
137
  *
138
  * @param string $output The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to a WP_Post
139
  * object,an associative array, or a numeric array, respectively.
140
  * @param string $filter Type of filter to apply. Accepts 'raw', 'edit', 'db', or 'display' and other formats
141
  * supported by the specific type implementation.
 
142
  *
143
  * @return \WP_Post|array|null The post object version of this post type model or `null` if the post is not valid.
144
  */
145
- public function to_post( $output = OBJECT, $filter = 'raw' ) {
146
- $properties = $this->get_properties( $filter );
147
-
148
- // Clone the post to avoid side effects.
149
- $post = clone $this->post;
150
-
151
- // And decorate the clone with the properties.
152
- foreach ( $properties as $key => $value ) {
153
- $post->{$key} = $value;
154
- }
155
 
156
  switch ( $output ) {
157
  case ARRAY_A:
158
- return (array) $post;
159
  case ARRAY_N:
160
- return array_values( (array) $post );
161
  case OBJECT:
162
- default;
163
- return $post;
 
 
 
 
 
 
 
164
  }
165
  }
166
 
@@ -170,7 +216,6 @@ abstract class Base {
170
  * @since 4.9.18
171
  *
172
  * @param string $filter The kind of filter applied to the model.
173
- *
174
  * @return callable The closure, or callable, that should be used to cache this model when, and if, required.
175
  */
176
  protected function get_caching_callback( $filter ) {
@@ -183,24 +228,142 @@ abstract class Base {
183
  $callback = null;
184
 
185
  if ( wp_using_ext_object_cache() ) {
186
- /*
187
- * If any real caching is in place , then define a function to cache this event when, and if, one of the
188
- * lazy properties is loaded.
189
- * Cache by post ID and filter.
190
- */
191
- $cache_key = $cache_slug . '_' . $this->post->ID . '_' . $filter;
192
- $cache = new Cache();
193
- $callback = function () use ( $cache, $cache_key, $filter ) {
194
- $properties = $this->get_properties( $filter );
195
-
196
- /*
197
- * Cache without expiration, but only until a post of the types managed by The Events Calendar is
198
- * updated or created.
199
- */
200
- $cache->set( $cache_key, $properties, 0, Cache_Listener::TRIGGER_SAVE_POST );
201
- };
202
  }
203
 
204
  return $callback;
205
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  }
21
  * @package Tribe\Models\Post_Types
22
  */
23
  abstract class Base {
24
+ /**
25
+ * The key used to store pre-serializes properties data in the cache.
26
+ *
27
+ * @since TBD
28
+ */
29
+ public const PRE_SERIALIZED_PROPERTY = '_tec_pre_serialized';
30
+
31
  /**
32
  * The post object base for this post type instance.
33
  *
85
  }
86
 
87
  // Cache by post ID and filter.
88
+ $cache_key = $this->get_properties_cache_key( $filter );
89
 
90
  return ( new Cache() )->get( $cache_key, Cache_Listener::TRIGGER_SAVE_POST );
91
  }
109
  * @since 4.9.18
110
  *
111
  * @param string $filter The type of filter to get the properties for.
112
+ * @param bool $force Whether to force a rebuild of the properties or not.
113
  *
114
  * @return array The model properties. This value might be cached.
115
  */
116
+ protected function get_properties( $filter, bool $force = false ) {
117
+ $cached = ! $force ? $this->get_cached_properties( $filter ) : false;
118
 
119
  if ( false !== $cached ) {
120
+ // Un-serialize the pre-serialized properties now, when classes will be most likely defined.
121
+ $pre_serialized_properties = $cached[ self::PRE_SERIALIZED_PROPERTY ] ?? [];
122
+
123
+ foreach ( $pre_serialized_properties as $key => $value ) {
124
+ try {
125
+ $cached[ $key ] = unserialize( $value, [ 'allowed_classes' => true ] );
126
+ } catch ( \Throwable $t ) {
127
+ /*
128
+ * Deal with the case where plugin A, B, C were active when the cache was built,
129
+ * but B and C are now inactive. In this case the un-serialization will fail for
130
+ * any pre-serialized value using classes from B and C: here we gracefully ignore
131
+ * each one of those.
132
+ */
133
+ }
134
+ }
135
+
136
+ try {
137
+ // Allow models to apply further unserialization operations.
138
+ $cached = $this->scalar_unserialize_properties( $cached );
139
+
140
+ /**
141
+ * Allows filtering the properties of the post type model after they have been unserialized from the
142
+ * cache..
143
+ *
144
+ * @since TBD
145
+ *
146
+ * @param array<string,mixed> $cached The key-value map of the properties of the post type model.
147
+ * @param \WP_Post $post The post object of the post type model.
148
+ */
149
+ $cached = apply_filters( "tec_model_{$this->get_cache_slug()}_read_cache_properties", $cached, $this->post );
150
+
151
+ // Remove the pre-serialized properties from the cached properties.
152
+ unset( $cached[ self::PRE_SERIALIZED_PROPERTY ] );
153
+
154
+ return $cached;
155
+ } catch ( \Throwable $t ) {
156
+ // Rebuid the properties from cache failed, move on.
157
+ }
158
  }
159
 
160
  $props = $this->build_properties( $filter );
179
  * Returns the WP_Post version of this model.
180
  *
181
  * @since 4.9.18
182
+ * @since TBD Added the `$force` parameter.
183
  *
184
  * @param string $output The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to a WP_Post
185
  * object,an associative array, or a numeric array, respectively.
186
  * @param string $filter Type of filter to apply. Accepts 'raw', 'edit', 'db', or 'display' and other formats
187
  * supported by the specific type implementation.
188
+ * @param bool $force Whether to force the post to be reloaded from the database or not.
189
  *
190
  * @return \WP_Post|array|null The post object version of this post type model or `null` if the post is not valid.
191
  */
192
+ public function to_post( $output = OBJECT, $filter = 'raw', bool $force = false ) {
193
+ $properties = $this->get_properties( $filter, $force );
 
 
 
 
 
 
 
 
194
 
195
  switch ( $output ) {
196
  case ARRAY_A:
197
+ return array_merge( (array) $this->post, $properties );
198
  case ARRAY_N:
199
+ return array_values( array_merge( (array) $this->post, $properties ) );
200
  case OBJECT:
201
+ default:
202
+ // Clone the post to avoid side effects.
203
+ $clone = clone $this->post;
204
+ // And decorate the clone with the properties.
205
+ foreach ( $properties as $key => $value ) {
206
+ $clone->{$key} = $value;
207
+ }
208
+
209
+ return $clone;
210
  }
211
  }
212
 
216
  * @since 4.9.18
217
  *
218
  * @param string $filter The kind of filter applied to the model.
 
219
  * @return callable The closure, or callable, that should be used to cache this model when, and if, required.
220
  */
221
  protected function get_caching_callback( $filter ) {
228
  $callback = null;
229
 
230
  if ( wp_using_ext_object_cache() ) {
231
+ $callback = $this->get_object_cache_callback( $filter );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
233
 
234
  return $callback;
235
  }
236
+
237
+ /**
238
+ * Further scalarizes the properties of the post type model.
239
+ *
240
+ * Extending classes should implement this method to handle
241
+ * specific scalarization of the model properties.
242
+ *
243
+ * @since TBD
244
+ *
245
+ * @param array<string,mixed> $properties A key-value map of the
246
+ * properties of the post type model.
247
+ *
248
+ * @return array<string,mixed> The scalarized properties key-value map.
249
+ */
250
+ protected function scalar_serialize_properties( array $properties ): array {
251
+ return $properties;
252
+ }
253
+
254
+ /**
255
+ * Further un-scalarizes the properties of the post type model.
256
+ *
257
+ * Extending classes should implement this method to handle
258
+ * specific un-scalarization of the model properties.
259
+ *
260
+ * @since TBD
261
+ *
262
+ * @param array<string,mixed> $properties A key-value map of the
263
+ * properties of the post type model.
264
+ *
265
+ * @return array<string,mixed> The un-scalarized properties key-value map.
266
+ */
267
+ protected function scalar_unserialize_properties( array $properties ): array {
268
+ return $properties;
269
+ }
270
+
271
+ /**
272
+ * Returns the callback function that should be used to cache the model using object caching.
273
+ *
274
+ * If any real caching is in place , then define a function to cache this event when, and if, one of the
275
+ * lazy properties is loaded.
276
+ * Cache by post ID and filter.
277
+ * Cache could be pre-fetched: in that case only built-in PHP classes will be supported: for this reason
278
+ * object properties will be "scalarized".
279
+ *
280
+ * @since TBD
281
+ *
282
+ * @param string $cache_slug The cache slug of the post type model.
283
+ * @param string $filter The filter to cache the model for.
284
+ *
285
+ * @return \Closure The callback function that should be used to cache the model using object caching.
286
+ */
287
+ protected function get_object_cache_callback( string $filter ): \Closure {
288
+ $cache_key = $this->get_properties_cache_key( $filter );
289
+ $cache = new Cache();
290
+
291
+ return function () use ( $cache, $cache_key, $filter ) {
292
+ $properties = $this->get_properties( $filter );
293
+ $pre_serialized_properties = [];
294
+
295
+ try {
296
+ // Pre-serialize each object property and store it in a separate cache entry.
297
+ foreach ( $properties as $key => &$value ) {
298
+ try {
299
+ if ( is_object( $value ) && ! $value instanceof \stdClass ) {
300
+ // We might end up pre-serializing other built-in objects here, but let's play it safe.
301
+ $pre_serialized_properties[ $key ] = serialize( $value );
302
+ }
303
+ } catch ( \Throwable $t ) {
304
+ // Null the property: an object that cannot be serialized correctly is not cacheable.
305
+ $value = null;
306
+ }
307
+ }
308
+ unset( $value );
309
+
310
+ // Remove the pre-serialized properties from the main cache entry.
311
+ $properties = array_diff_key( $properties, $pre_serialized_properties );
312
+
313
+ // Allow models to customize the pre-serialization further.
314
+ $properties = $this->scalar_serialize_properties( $properties );
315
+
316
+ // Add the pre-serialized properties to the main cache entry.
317
+ if ( count( $pre_serialized_properties ) ) {
318
+ $properties[ self::PRE_SERIALIZED_PROPERTY ] = $pre_serialized_properties;
319
+ }
320
+
321
+ /**
322
+ * Allows filtering the properties of the post type model before they are cached.
323
+ *
324
+ * @since TBD
325
+ *
326
+ * @param array<string,mixed> $properties The key-value map of the properties of the post type model.
327
+ * @param \WP_Post $post The post object of the post type model.
328
+ */
329
+ $properties = apply_filters( "tec_model_{$this->get_cache_slug()}_put_cache_properties", $properties, $this->post );
330
+ } catch ( \Throwable $t ) {
331
+ // If we can't serialize the properties, bail.
332
+ return;
333
+ }
334
+
335
+ /*
336
+ * Cache without expiration, but only until a post of the types managed by The Events Calendar is
337
+ * updated or created.
338
+ */
339
+ $cache->set( $cache_key, $properties, 0, Cache_Listener::TRIGGER_SAVE_POST );
340
+ };
341
+ }
342
+
343
+ /**
344
+ * Returns the cache key to be used to cache the model properties.
345
+ *
346
+ * @since TBD
347
+ *
348
+ * @param string $filter The filter to cache the model for.
349
+ *
350
+ * @return string The cache key to be used to cache the model properties.
351
+ */
352
+ public function get_properties_cache_key( string $filter ): string {
353
+ return $this->get_cache_slug() . '_' . $this->post->ID . '_' . $filter;
354
+ }
355
+
356
+ /**
357
+ * Commits the model properties to cache immediately.
358
+ *
359
+ * @since TBD
360
+ *
361
+ * @param string $filter The filter to cache the model properties for.
362
+ *
363
+ * @return void The model properties are cached immediately.
364
+ */
365
+ public function commit_to_cache( string $filter = 'raw' ): void {
366
+ $caching_callback = $this->get_object_cache_callback( $filter );
367
+ $caching_callback();
368
+ }
369
  }
common/src/Tribe/Models/Post_Types/Nothing.php CHANGED
@@ -38,7 +38,7 @@ class Nothing extends Base {
38
  /**
39
  * {@inheritDoc}
40
  */
41
- public function to_post( $output = OBJECT, $filter = 'raw' ) {
42
  return null;
43
  }
44
  }
38
  /**
39
  * {@inheritDoc}
40
  */
41
+ public function to_post( $output = OBJECT, $filter = 'raw', bool $force = false ) {
42
  return null;
43
  }
44
  }
common/vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd859b498033b0033d130b8bfa9e109cb::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInita700ed1786526ecf9c5f43482d4d32a5::getLoader();
common/vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit2b83e7ed6e0ca71be6b23d3d7d27b447::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit2d50c4f3f5d4e4dc8d10d875c74d8110::getLoader();
common/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd859b498033b0033d130b8bfa9e109cb
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitd859b498033b0033d130b8bfa9e109cb
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitd859b498033b0033d130b8bfa9e109cb', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitd859b498033b0033d130b8bfa9e109cb', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitd859b498033b0033d130b8bfa9e109cb::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInita700ed1786526ecf9c5f43482d4d32a5
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInita700ed1786526ecf9c5f43482d4d32a5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInita700ed1786526ecf9c5f43482d4d32a5', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInita700ed1786526ecf9c5f43482d4d32a5::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
common/vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit2b83e7ed6e0ca71be6b23d3d7d27b447 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit2b83e7ed6e0ca71be6b23d3d7d27b447 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit2b83e7ed6e0ca71be6b23d3d7d27b447', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit2b83e7ed6e0ca71be6b23d3d7d27b447', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit2d50c4f3f5d4e4dc8d10d875c74d8110 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit2d50c4f3f5d4e4dc8d10d875c74d8110', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit2d50c4f3f5d4e4dc8d10d875c74d8110', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
common/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitd859b498033b0033d130b8bfa9e109cb
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -273,10 +273,10 @@ class ComposerStaticInitd859b498033b0033d130b8bfa9e109cb
273
  public static function getInitializer(ClassLoader $loader)
274
  {
275
  return \Closure::bind(function () use ($loader) {
276
- $loader->prefixLengthsPsr4 = ComposerStaticInitd859b498033b0033d130b8bfa9e109cb::$prefixLengthsPsr4;
277
- $loader->prefixDirsPsr4 = ComposerStaticInitd859b498033b0033d130b8bfa9e109cb::$prefixDirsPsr4;
278
- $loader->prefixesPsr0 = ComposerStaticInitd859b498033b0033d130b8bfa9e109cb::$prefixesPsr0;
279
- $loader->classMap = ComposerStaticInitd859b498033b0033d130b8bfa9e109cb::$classMap;
280
 
281
  }, null, ClassLoader::class);
282
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInita700ed1786526ecf9c5f43482d4d32a5
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
273
  public static function getInitializer(ClassLoader $loader)
274
  {
275
  return \Closure::bind(function () use ($loader) {
276
+ $loader->prefixLengthsPsr4 = ComposerStaticInita700ed1786526ecf9c5f43482d4d32a5::$prefixLengthsPsr4;
277
+ $loader->prefixDirsPsr4 = ComposerStaticInita700ed1786526ecf9c5f43482d4d32a5::$prefixDirsPsr4;
278
+ $loader->prefixesPsr0 = ComposerStaticInita700ed1786526ecf9c5f43482d4d32a5::$prefixesPsr0;
279
+ $loader->classMap = ComposerStaticInita700ed1786526ecf9c5f43482d4d32a5::$classMap;
280
 
281
  }, null, ClassLoader::class);
282
  }
lang/the-events-calendar-de_CH.mo CHANGED
Binary file
lang/the-events-calendar-de_CH_informal.mo ADDED
Binary file
lang/the-events-calendar-de_DE.mo CHANGED
Binary file
lang/the-events-calendar-de_DE_formal.mo ADDED
Binary file
lang/the-events-calendar-fr_FR.mo CHANGED
Binary file
lang/the-events-calendar-gl_ES.mo CHANGED
Binary file
lang/the-events-calendar-it_IT.mo CHANGED
Binary file
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: theeventscalendar, borkweb, bordoni, brianjessee, aguseo, camwynsp
4
  Tags: events, calendar, event, schedule, organizer
5
  Donate link: https://evnt.is/29
6
  Requires at least: 5.8.5
7
- Stable tag: 6.0.3
8
- Tested up to: 6.0.3
9
  Requires PHP: 7.3
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -229,6 +229,13 @@ Remember to always make a backup of your database and files before updating!
229
 
230
  == Changelog ==
231
 
 
 
 
 
 
 
 
232
  = [6.0.3] 2022-10-31 =
233
 
234
  * Fix - Handle repository query filters correctly in custom tables context; fix a REST API issue. [ET-1567]
4
  Tags: events, calendar, event, schedule, organizer
5
  Donate link: https://evnt.is/29
6
  Requires at least: 5.8.5
7
+ Stable tag: 6.0.3.1
8
+ Tested up to: 6.1
9
  Requires PHP: 7.3
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
229
 
230
  == Changelog ==
231
 
232
+ = [6.0.3.1] 2022-11-03 =
233
+
234
+ * Fix - Correct issues where early queries can interfere with View template redirects. [TEC-4554]
235
+ * Fix - Serialization and unserialization issues related to caching of post models. [TEC-4379]
236
+ * Fix - Prevent default WordPress occurrence query caching because we cache it ourselves. [TEC-4379]
237
+ * Tweak - Add the `tribe_get_venue_object_after` and `tribe_get_organizer_object_after` filters. [TEC-4379]
238
+
239
  = [6.0.3] 2022-10-31 =
240
 
241
  * Fix - Handle repository query filters correctly in custom tables context; fix a REST API issue. [ET-1567]
src/Events/Custom_Tables/V1/Integrations/Dot_Com/Clear_Event_Cache.php CHANGED
@@ -55,7 +55,7 @@ class Clear_Event_Cache {
55
 
56
  $posts = wp_cache_get( $cache_hash, static::$cache_group_key );
57
  if ( empty( $posts ) ) {
58
- return $posts;
59
  }
60
 
61
  $post = reset( $posts );
55
 
56
  $posts = wp_cache_get( $cache_hash, static::$cache_group_key );
57
  if ( empty( $posts ) ) {
58
+ return [];
59
  }
60
 
61
  $post = reset( $posts );
src/Events/Custom_Tables/V1/Integrations/Provider.php CHANGED
@@ -35,5 +35,10 @@ class Provider extends Service_Provider {
35
  // WP.com specific integrations.
36
  $this->container->register( Dot_Com\Provider::class );
37
  }
 
 
 
 
 
38
  }
39
  }
35
  // WP.com specific integrations.
36
  $this->container->register( Dot_Com\Provider::class );
37
  }
38
+
39
+ if ( function_exists( 'is_wpe' ) ) {
40
+ // WP Engine specific integrations.
41
+ $this->container->register( WP_Engine\Provider::class );
42
+ }
43
  }
44
  }
src/Events/Custom_Tables/V1/Integrations/WP_Engine/Clear_Event_Cache.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Provides the integrations required by the plugin to work with other plugins.
4
+ *
5
+ * @since 6.0.2
6
+ *
7
+ * @package TEC\Events\Custom_Tables\V1\Integrations
8
+ */
9
+
10
+ namespace TEC\Events\Custom_Tables\V1\Integrations\WP_Engine;
11
+
12
+ use WP_Query;
13
+ use WP_Post;
14
+
15
+ /**
16
+ * Class Clear_Event_Cache
17
+ *
18
+ * @since 6.0.2.1
19
+ *
20
+ */
21
+ class Clear_Event_Cache {
22
+
23
+ /**
24
+ * The cache group key for the WP.com event caching.
25
+ *
26
+ * @since 6.0.2.1
27
+ *
28
+ * @var string
29
+ */
30
+ public static $cache_group_key = 'tec_wp_engine_queries';
31
+
32
+ /**
33
+ * Clears the Single Event Post Cache due to how weirdly broken cache ends up for WP.com single event due to occurrences.
34
+ *
35
+ * @since 6.0.2.1
36
+ *
37
+ * @param array<WP_Post|int>|null $posts The filter input value, it could have already be filtered by other
38
+ * @param WP_Query|null $wp_query A reference to the `WP_Query` instance that is currently running.
39
+ * plugins at this stage.
40
+ *
41
+ * @return null|array<WP_Post|int> The filtered value of the posts, injected before the query actually runs.
42
+ */
43
+ public function filter_posts_pre_query( $posts = null, $wp_query = null ) {
44
+ if ( ! $wp_query instanceof WP_Query ) {
45
+ return $posts;
46
+ }
47
+
48
+ $cache_hash = md5( serialize( $wp_query->query ) );
49
+
50
+ if ( $wp_query->request !== 'SELECT * FROM wp_posts WHERE ID IN(0)' ) {
51
+ if ( ! empty( $posts ) ) {
52
+ wp_cache_add( $cache_hash, $posts, static::$cache_group_key );
53
+ }
54
+ }
55
+
56
+ $posts = wp_cache_get( $cache_hash, static::$cache_group_key );
57
+ if ( empty( $posts ) ) {
58
+ return [];
59
+ }
60
+
61
+ $post = reset( $posts );
62
+ if ( $post instanceof WP_Post ) {
63
+ clean_post_cache( $post );
64
+ }
65
+
66
+ return $posts;
67
+ }
68
+ }
src/Events/Custom_Tables/V1/Integrations/WP_Engine/Provider.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace TEC\Events\Custom_Tables\V1\Integrations\WP_Engine;
4
+
5
+ use tad_DI52_ServiceProvider as Service_Provider;
6
+ use WP_Query;
7
+ use WP_Post;
8
+
9
+ /**
10
+ * Class Provider
11
+ *
12
+ * @since 6.0.2.1
13
+ *
14
+ * @package TEC\Events\Custom_Tables\V1\Integrations\WP_Engine
15
+ */
16
+ class Provider extends Service_Provider {
17
+
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ public function register() {
22
+ add_filter( 'tec_events_custom_tables_v1_events_only_modifier_filter_posts_pre_query', [
23
+ $this,
24
+ 'filter_posts_pre_query'
25
+ ], 101, 2 );
26
+ }
27
+
28
+ /**
29
+ * Unhooks all the actions and filters.
30
+ *
31
+ * @since 6.0.2.1
32
+ */
33
+ protected function unregister(): void {
34
+ remove_filter( 'tec_events_custom_tables_v1_events_only_modifier_filter_posts_pre_query', [
35
+ $this,
36
+ 'filter_posts_pre_query'
37
+ ], 101 );
38
+ }
39
+
40
+ /**
41
+ * Clears the Single Event Post Cache due to how weirdly broken cache ends up for WP.com single event due to
42
+ * occurrences.
43
+ *
44
+ * @since 6.0.2
45
+ *
46
+ * @param array<WP_Post|int>|null $posts The filter input value, it could have already be filtered by other
47
+ * @param WP_Query|null $wp_query A reference to the `WP_Query` instance that is currently running.
48
+ * plugins at this stage.
49
+ *
50
+ * @return null|array<WP_Post|int> The filtered value of the posts, injected before the query actually runs.
51
+ */
52
+ public function filter_posts_pre_query( $posts = null, $wp_query = null ) {
53
+ return $this->container->make( Clear_Event_Cache::class )->filter_posts_pre_query( $posts, $wp_query );
54
+ }
55
+
56
+ }
src/Events/Custom_Tables/V1/WP_Query/Custom_Tables_Query.php CHANGED
@@ -143,11 +143,12 @@ class Custom_Tables_Query extends WP_Query {
143
  $monitor = tribe(Custom_Tables_Query_Monitor::class);
144
  $monitor->attach( $this );
145
 
146
- // This "parallel" query should not be manipulated from other query managers.
147
  $this->set( 'tribe_suppress_query_filters', true );
148
  $this->tribe_suppress_query_filters = true;
149
  $this->set( 'tribe_include_date_meta', false );
150
  $this->tribe_include_date_meta = false;
 
151
 
152
  /**
153
  * Fires before the Custom Tables query runs.
143
  $monitor = tribe(Custom_Tables_Query_Monitor::class);
144
  $monitor->attach( $this );
145
 
146
+ // This "parallel" query should not be manipulated from other query managers.
147
  $this->set( 'tribe_suppress_query_filters', true );
148
  $this->tribe_suppress_query_filters = true;
149
  $this->set( 'tribe_include_date_meta', false );
150
  $this->tribe_include_date_meta = false;
151
+ $this->set( 'cache_results', false );
152
 
153
  /**
154
  * Fires before the Custom Tables query runs.
src/Tribe/Collections/Lazy_Post_Collection.php CHANGED
@@ -62,7 +62,9 @@ class Lazy_Post_Collection extends Lazy_Collection {
62
  protected function before_serialize( array $items ) {
63
  return [
64
  'callback' => $this->unserialize_callback,
65
- 'ids' => wp_list_pluck( $items, 'ID' ),
 
 
66
  ];
67
  }
68
 
62
  protected function before_serialize( array $items ) {
63
  return [
64
  'callback' => $this->unserialize_callback,
65
+ 'ids' => array_map( static function ( $item ): int {
66
+ return $item instanceof \WP_Post ? $item->ID : (int) $item;
67
+ }, $items ),
68
  ];
69
  }
70
 
src/Tribe/Main.php CHANGED
@@ -37,7 +37,7 @@ if ( ! class_exists( 'Tribe__Events__Main' ) ) {
37
  const VENUE_POST_TYPE = 'tribe_venue';
38
  const ORGANIZER_POST_TYPE = 'tribe_organizer';
39
 
40
- const VERSION = '6.0.3';
41
 
42
  /**
43
  * Min Pro Addon
37
  const VENUE_POST_TYPE = 'tribe_venue';
38
  const ORGANIZER_POST_TYPE = 'tribe_organizer';
39
 
40
+ const VERSION = '6.0.3.1';
41
 
42
  /**
43
  * Min Pro Addon
src/Tribe/Models/Post_Types/Event.php CHANGED
@@ -14,6 +14,8 @@ use DatePeriod;
14
  use DateTimeZone;
15
  use Tribe\Events\Collections\Lazy_Post_Collection;
16
  use Tribe\Models\Post_Types\Base;
 
 
17
  use Tribe\Utils\Lazy_Boolean;
18
  use Tribe\Utils\Lazy_Collection;
19
  use Tribe\Utils\Lazy_String;
@@ -333,4 +335,59 @@ class Event extends Base {
333
 
334
  _prime_post_caches( $posts );
335
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
14
  use DateTimeZone;
15
  use Tribe\Events\Collections\Lazy_Post_Collection;
16
  use Tribe\Models\Post_Types\Base;
17
+ use Tribe\Utils\Date_I18n;
18
+ use Tribe\Utils\Date_I18n_Immutable;
19
  use Tribe\Utils\Lazy_Boolean;
20
  use Tribe\Utils\Lazy_Collection;
21
  use Tribe\Utils\Lazy_String;
335
 
336
  _prime_post_caches( $posts );
337
  }
338
+
339
+ /**
340
+ * Overrides the base method to conver the I18n Dates to PHP built-in Date types.
341
+ *
342
+ * @since TBD
343
+ *
344
+ * @param array<string,mixed> $properties The properties to filter.
345
+ *
346
+ * @return array<string,mixed> The filtered properties.
347
+ *
348
+ * @throws \Exception If a date cannot be converted to a DateTime object.
349
+ */
350
+ protected function scalar_serialize_properties( array $properties ): array {
351
+ // Convert the dates to built-in PHP date objects.
352
+ $properties['dates'] = array_map( static function ( $date ) {
353
+ if ( $date instanceof Date_I18n_Immutable ) {
354
+ return new \DateTimeImmutable( $date->format( 'Y-m-d H:i:s' ), $date->getTimezone() );
355
+ }
356
+
357
+ if ( $date instanceof Date_I18n ) {
358
+ return new \DateTime( $date->format( 'Y-m-d H:i:s' ), $date->getTimezone() );
359
+ }
360
+
361
+ return $date;
362
+ }, get_object_vars( $properties['dates'] ) );
363
+
364
+ return $properties;
365
+ }
366
+
367
+ /**
368
+ * Overrides the base method to convert date properties to I18n Dates.
369
+ *
370
+ * @since TBD
371
+ *
372
+ * @param array<string,mixed> $properties The properties to filter.
373
+ *
374
+ * @return array<string,mixed> The filtered properties.
375
+ *
376
+ * @throws \Exception If a date cannot be converted to a I18n Date object.
377
+ */
378
+ protected function scalar_unserialize_properties( array $properties ): array {
379
+ $properties['dates'] = (object) array_map( static function ( $date ) {
380
+ if ( $date instanceof \DateTimeImmutable ) {
381
+ return new Date_I18n_Immutable( $date->format( 'Y-m-d H:i:s' ), $date->getTimezone() );
382
+ }
383
+
384
+ if ( $date instanceof \DateTime ) {
385
+ return new Date_I18n( $date->format( 'Y-m-d H:i:s' ), $date->getTimezone() );
386
+ }
387
+
388
+ return $date;
389
+ }, $properties['dates'] ?? [] );
390
+
391
+ return $properties;
392
+ }
393
  }
src/Tribe/Updater.php CHANGED
@@ -338,6 +338,7 @@ class Tribe__Events__Updater {
338
 
339
  // Update reason to central source.
340
  update_post_meta( $event_id, Event_Status_Meta::$key_status_reason, $reason );
 
341
  }
342
  }
343
  }
338
 
339
  // Update reason to central source.
340
  update_post_meta( $event_id, Event_Status_Meta::$key_status_reason, $reason );
341
+ clean_post_cache( $event_id );
342
  }
343
  }
344
  }
src/Tribe/Views/V2/Template_Bootstrap.php CHANGED
@@ -194,7 +194,7 @@ class Template_Bootstrap {
194
  public function get_view_html() {
195
  $query = tribe_get_global_query_object();
196
  $context = tribe_context();
197
- $view_slug = $context->get( 'view' );
198
 
199
  /**
200
  * Filters the HTML for the view before we do any other logic around that.
194
  public function get_view_html() {
195
  $query = tribe_get_global_query_object();
196
  $context = tribe_context();
197
+ $view_slug = $context->get( 'event_display' );
198
 
199
  /**
200
  * Filters the HTML for the view before we do any other logic around that.
src/functions/template-tags/event.php CHANGED
@@ -98,17 +98,15 @@ if ( ! function_exists( 'tribe_get_event' ) ) {
98
  return $return;
99
  }
100
 
101
- $post = false;
102
-
103
- /** @var Tribe__Cache $cache */
104
- $cache = tribe( 'cache' );
105
-
106
  $cache_post = get_post( $event );
107
 
108
  if ( empty( $cache_post ) ) {
109
  return null;
110
  }
111
 
 
 
 
112
  if ( ! isset( $cache['option_start_of_week'] ) ) {
113
  $cache['option_start_of_week'] = get_option( 'start_of_week' );
114
  }
@@ -119,6 +117,7 @@ if ( ! function_exists( 'tribe_get_event' ) ) {
119
  $cache['option_gmt_offset'] = get_option( 'gmt_offset' );
120
  }
121
 
 
122
  $key_fields = [
123
  $cache_post->ID,
124
  $cache_post->post_modified,
@@ -137,28 +136,12 @@ if ( ! function_exists( 'tribe_get_event' ) ) {
137
 
138
  $cache_key = 'tribe_get_event_' . md5( wp_json_encode( $key_fields ) );
139
 
140
- if ( ! $force ) {
141
- $initial_unserialize_callback = ini_get( 'unserialize_callback_func' );
142
- // Prevent warning from happening.
143
- ini_set( 'unserialize_callback_func', '__return_false' );
144
-
145
- $post = $cache->get( $cache_key, Tribe__Cache_Listener::TRIGGER_SAVE_POST );
146
 
147
- if ( ! $post instanceof WP_Post ) {
148
- // If not a WP_Post we reset value, so it ignores cache.
149
- $post = false;
150
- }
151
-
152
- // Revert to the original value.
153
- ini_set( 'unserialize_callback_func', $initial_unserialize_callback );
154
- }
155
-
156
- if ( false === $post ) {
157
- $post = Event::from_post( $event )->to_post( OBJECT, $filter );
158
-
159
- if ( empty( $post ) ) {
160
- return null;
161
- }
162
 
163
  /**
164
  * Filters the event post object before caching it and returning it.
@@ -175,10 +158,12 @@ if ( ! function_exists( 'tribe_get_event' ) ) {
175
  */
176
  $post = apply_filters( 'tribe_get_event', $post, $output, $filter );
177
 
178
- // Don't try to reset cache when forcing.
179
- if ( ! $force ) {
180
- $cache->set( $cache_key, $post, WEEK_IN_SECONDS, Tribe__Cache_Listener::TRIGGER_SAVE_POST );
181
- }
 
 
182
  }
183
 
184
  /**
98
  return $return;
99
  }
100
 
 
 
 
 
 
101
  $cache_post = get_post( $event );
102
 
103
  if ( empty( $cache_post ) ) {
104
  return null;
105
  }
106
 
107
+ /** @var Tribe__Cache $cache */
108
+ $cache = tribe( 'cache' );
109
+
110
  if ( ! isset( $cache['option_start_of_week'] ) ) {
111
  $cache['option_start_of_week'] = get_option( 'start_of_week' );
112
  }
117
  $cache['option_gmt_offset'] = get_option( 'gmt_offset' );
118
  }
119
 
120
+ // Build a memoization cache key salted by the request parameters.
121
  $key_fields = [
122
  $cache_post->ID,
123
  $cache_post->post_modified,
136
 
137
  $cache_key = 'tribe_get_event_' . md5( wp_json_encode( $key_fields ) );
138
 
139
+ // Try getting the memoized value.
140
+ $post = $cache[ $cache_key ];
 
 
 
 
141
 
142
+ if ( $post === false ) {
143
+ // No memoized value, build from properties.
144
+ $post = Event::from_post( $event )->to_post( OBJECT, $filter, $force );
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
  /**
147
  * Filters the event post object before caching it and returning it.
158
  */
159
  $post = apply_filters( 'tribe_get_event', $post, $output, $filter );
160
 
161
+ // Memoize the value.
162
+ $cache[ $cache_key ] = $post;
163
+ }
164
+
165
+ if ( empty( $post ) ) {
166
+ return null;
167
  }
168
 
169
  /**
src/functions/template-tags/organizer.php CHANGED
@@ -603,21 +603,17 @@ function tribe_get_organizer_object( $organizer = null, $output = OBJECT, $filte
603
  return $return;
604
  }
605
 
606
- $post = false;
607
- if ( ! $force ) {
608
- $cache_key = 'tribe_get_organizer_object_' . md5( json_encode( [ $organizer, $output, $filter ] ) );
609
- /** @var Tribe__Cache $cache */
610
- $cache = tribe( 'cache' );
611
- $post = $cache->get( $cache_key, Tribe__Cache_Listener::TRIGGER_SAVE_POST );
612
- }
613
 
614
  if ( false === $post ) {
 
615
  $post = Organizer::from_post( $organizer )->to_post( $output, $filter );
616
 
617
- if ( empty( $post ) ) {
618
- return null;
619
- }
620
-
621
  /**
622
  * Filters the organizer post object before caching it and returning it.
623
  *
@@ -633,9 +629,30 @@ function tribe_get_organizer_object( $organizer = null, $output = OBJECT, $filte
633
  */
634
  $post = apply_filters( 'tribe_get_organizer_object', $post, $output, $filter );
635
 
636
- $cache->set( $cache_key, $post, WEEK_IN_SECONDS, Tribe__Cache_Listener::TRIGGER_SAVE_POST );
 
637
  }
638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  if ( OBJECT !== $output ) {
640
  $post = ARRAY_A === $output ? (array) $post : array_values( (array) $post );
641
  }
603
  return $return;
604
  }
605
 
606
+ /** @var Tribe__Cache $cache */
607
+ $cache = tribe( 'cache' );
608
+ $cache_key = 'tribe_get_organizer_object_' . md5( json_encode( [ $organizer, $output, $filter ] ) );
609
+
610
+ // Try getting the memoized value.
611
+ $post = $cache[ $cache_key ];
 
612
 
613
  if ( false === $post ) {
614
+ // No memoized value, build from properties.
615
  $post = Organizer::from_post( $organizer )->to_post( $output, $filter );
616
 
 
 
 
 
617
  /**
618
  * Filters the organizer post object before caching it and returning it.
619
  *
629
  */
630
  $post = apply_filters( 'tribe_get_organizer_object', $post, $output, $filter );
631
 
632
+ // Memoize the value.
633
+ $cache[ $cache_key ] = $post;
634
  }
635
 
636
+ if ( empty( $post ) ) {
637
+ return null;
638
+ }
639
+
640
+ /**
641
+ * Filters the organizer result after the organizer has been built from the function.
642
+ *
643
+ * Note: this value will not be cached and the caching of this value is a duty left to the filtering function.
644
+ *
645
+ * @since TBD
646
+ *
647
+ * @param WP_Post $post The organizer post object to filter and return.
648
+ * @param int|WP_Post $organizer The organizer object to fetch.
649
+ * @param string|null $output The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
650
+ * correspond to a `WP_Post` object, an associative array, or a numeric array,
651
+ * respectively. Defaults to `OBJECT`.
652
+ * @param string $filter The filter, or context of the fetch.
653
+ */
654
+ $post = apply_filters( 'tribe_get_organiser_object_after', $post, $organizer, $output, $filter );
655
+
656
  if ( OBJECT !== $output ) {
657
  $post = ARRAY_A === $output ? (array) $post : array_values( (array) $post );
658
  }
src/functions/template-tags/venue.php CHANGED
@@ -57,20 +57,17 @@ function tribe_get_venue_object( $venue = null, $output = OBJECT, $filter = 'raw
57
  return $return;
58
  }
59
 
60
- $post = false;
61
- if ( ! $force ) {
62
- $cache_key = 'tribe_get_venue_object_' . md5( json_encode( [ $venue, $output, $filter ] ) );
63
- /** @var Tribe__Cache $cache */
64
- $cache = tribe( 'cache' );
65
- $post = $cache->get( $cache_key, Tribe__Cache_Listener::TRIGGER_SAVE_POST );
66
- }
67
 
68
  if ( false === $post ) {
 
69
  $post = Venue::from_post( $venue )->to_post( $output, $filter );
70
 
71
- if ( empty( $post ) ) {
72
- return null;
73
- }
74
  /**
75
  * Filters the venue post object before caching it and returning it.
76
  *
@@ -86,9 +83,30 @@ function tribe_get_venue_object( $venue = null, $output = OBJECT, $filter = 'raw
86
  */
87
  $post = apply_filters( 'tribe_get_venue_object', $post, $output, $filter );
88
 
89
- $cache->set( $cache_key, $post, WEEK_IN_SECONDS, Tribe__Cache_Listener::TRIGGER_SAVE_POST );
 
 
 
 
 
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  if ( OBJECT !== $output ) {
93
  $post = ARRAY_A === $output ? (array) $post : array_values( (array) $post );
94
  }
57
  return $return;
58
  }
59
 
60
+ /** @var Tribe__Cache $cache */
61
+ $cache = tribe( 'cache' );
62
+ $cache_key = 'tribe_get_venue_object_' . md5( json_encode( [ $venue, $output, $filter ] ) );
63
+
64
+ // Try getting the memoized value.
65
+ $post = $cache[ $cache_key ];
 
66
 
67
  if ( false === $post ) {
68
+ // No memoized value, build from properties.
69
  $post = Venue::from_post( $venue )->to_post( $output, $filter );
70
 
 
 
 
71
  /**
72
  * Filters the venue post object before caching it and returning it.
73
  *
83
  */
84
  $post = apply_filters( 'tribe_get_venue_object', $post, $output, $filter );
85
 
86
+ // Memoize the value.
87
+ $cache[ $cache_key ] = $post;
88
+ }
89
+
90
+ if ( empty( $post ) ) {
91
+ return null;
92
  }
93
 
94
+ /**
95
+ * Filters the venue result after the venue has been built from the function.
96
+ *
97
+ * Note: this value will not be cached and the caching of this value is a duty left to the filtering function.
98
+ *
99
+ * @since TBD
100
+ *
101
+ * @param WP_Post $post The venue post object to filter and return.
102
+ * @param int|WP_Post $venue The venue object to fetch.
103
+ * @param string|null $output The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
104
+ * correspond to a `WP_Post` object, an associative array, or a numeric array,
105
+ * respectively. Defaults to `OBJECT`.
106
+ * @param string $filter The filter, or context of the fetch.
107
+ */
108
+ $post = apply_filters( 'tribe_get_venue_object_after', $post, $venue, $output, $filter );
109
+
110
  if ( OBJECT !== $output ) {
111
  $post = ARRAY_A === $output ? (array) $post : array_values( (array) $post );
112
  }
the-events-calendar.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: The Events Calendar
4
  * Description: The Events Calendar is a carefully crafted, extensible plugin that lets you easily share your events. Beautiful. Solid. Awesome.
5
- * Version: 6.0.3
6
  * Author: The Events Calendar
7
  * Author URI: https://evnt.is/1x
8
  * Text Domain: the-events-calendar
2
  /**
3
  * Plugin Name: The Events Calendar
4
  * Description: The Events Calendar is a carefully crafted, extensible plugin that lets you easily share your events. Beautiful. Solid. Awesome.
5
+ * Version: 6.0.3.1
6
  * Author: The Events Calendar
7
  * Author URI: https://evnt.is/1x
8
  * Text Domain: the-events-calendar
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit7f946b61ad36942b6c3d8cb558a71695::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit04d91d2efaff4fa800c51dad371332bd::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -17,6 +17,8 @@ return array(
17
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Clear_Event_Cache' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Clear_Event_Cache.php',
18
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Provider' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Provider.php',
19
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Provider' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/Provider.php',
 
 
20
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Phase_View_Renderer' => $baseDir . '/src/Events/Custom_Tables/V1/Migration/Admin/Phase_View_Renderer.php',
21
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Progress_Modal' => $baseDir . '/src/Events/Custom_Tables/V1/Migration/Admin/Progress_Modal.php',
22
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Template' => $baseDir . '/src/Events/Custom_Tables/V1/Migration/Admin/Template.php',
17
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Clear_Event_Cache' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Clear_Event_Cache.php',
18
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Provider' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Provider.php',
19
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Provider' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/Provider.php',
20
+ 'TEC\\Events\\Custom_Tables\\V1\\Integrations\\WP_Engine\\Clear_Event_Cache' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/WP_Engine/Clear_Event_Cache.php',
21
+ 'TEC\\Events\\Custom_Tables\\V1\\Integrations\\WP_Engine\\Provider' => $baseDir . '/src/Events/Custom_Tables/V1/Integrations/WP_Engine/Provider.php',
22
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Phase_View_Renderer' => $baseDir . '/src/Events/Custom_Tables/V1/Migration/Admin/Phase_View_Renderer.php',
23
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Progress_Modal' => $baseDir . '/src/Events/Custom_Tables/V1/Migration/Admin/Progress_Modal.php',
24
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Template' => $baseDir . '/src/Events/Custom_Tables/V1/Migration/Admin/Template.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit7f946b61ad36942b6c3d8cb558a71695
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit7f946b61ad36942b6c3d8cb558a71695
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit7f946b61ad36942b6c3d8cb558a71695', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit7f946b61ad36942b6c3d8cb558a71695', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit04d91d2efaff4fa800c51dad371332bd
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit04d91d2efaff4fa800c51dad371332bd', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit04d91d2efaff4fa800c51dad371332bd', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit04d91d2efaff4fa800c51dad371332bd::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -37,6 +37,8 @@ class ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695
37
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Clear_Event_Cache' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Clear_Event_Cache.php',
38
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Provider' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Provider.php',
39
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Provider' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/Provider.php',
 
 
40
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Phase_View_Renderer' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Migration/Admin/Phase_View_Renderer.php',
41
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Progress_Modal' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Migration/Admin/Progress_Modal.php',
42
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Template' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Migration/Admin/Template.php',
@@ -276,9 +278,9 @@ class ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695
276
  public static function getInitializer(ClassLoader $loader)
277
  {
278
  return \Closure::bind(function () use ($loader) {
279
- $loader->prefixLengthsPsr4 = ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695::$prefixLengthsPsr4;
280
- $loader->prefixDirsPsr4 = ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695::$prefixDirsPsr4;
281
- $loader->classMap = ComposerStaticInit7f946b61ad36942b6c3d8cb558a71695::$classMap;
282
 
283
  }, null, ClassLoader::class);
284
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit04d91d2efaff4fa800c51dad371332bd
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
37
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Clear_Event_Cache' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Clear_Event_Cache.php',
38
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Dot_Com\\Provider' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/Dot_Com/Provider.php',
39
  'TEC\\Events\\Custom_Tables\\V1\\Integrations\\Provider' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/Provider.php',
40
+ 'TEC\\Events\\Custom_Tables\\V1\\Integrations\\WP_Engine\\Clear_Event_Cache' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/WP_Engine/Clear_Event_Cache.php',
41
+ 'TEC\\Events\\Custom_Tables\\V1\\Integrations\\WP_Engine\\Provider' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Integrations/WP_Engine/Provider.php',
42
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Phase_View_Renderer' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Migration/Admin/Phase_View_Renderer.php',
43
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Progress_Modal' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Migration/Admin/Progress_Modal.php',
44
  'TEC\\Events\\Custom_Tables\\V1\\Migration\\Admin\\Template' => __DIR__ . '/../..' . '/src/Events/Custom_Tables/V1/Migration/Admin/Template.php',
278
  public static function getInitializer(ClassLoader $loader)
279
  {
280
  return \Closure::bind(function () use ($loader) {
281
+ $loader->prefixLengthsPsr4 = ComposerStaticInit04d91d2efaff4fa800c51dad371332bd::$prefixLengthsPsr4;
282
+ $loader->prefixDirsPsr4 = ComposerStaticInit04d91d2efaff4fa800c51dad371332bd::$prefixDirsPsr4;
283
+ $loader->classMap = ComposerStaticInit04d91d2efaff4fa800c51dad371332bd::$classMap;
284
 
285
  }, null, ClassLoader::class);
286
  }