@@ -176,7 +176,7 @@ public static function get_post_type_registration_args(): array {
176
176
public static function get_post_meta_registration_args (): array {
177
177
return array (
178
178
'_online_event_link ' => array (
179
- 'auth_callback ' => function () {
179
+ 'auth_callback ' => function () {
180
180
return current_user_can ( 'edit_posts ' );
181
181
},
182
182
'sanitize_callback ' => 'sanitize_url ' ,
@@ -399,11 +399,10 @@ protected function get_formatted_datetime(
399
399
string $ which = 'start ' ,
400
400
bool $ local = true
401
401
): string {
402
+ $ cache_key = 'formatted_datetime_ ' . md5 ( $ format . $ which . ( $ local ? 'local ' : 'gmt ' ) );
402
403
403
- $ cache_key = 'formatted_datetime_ ' . md5 ($ format . $ which . ($ local ? 'local ' : 'gmt ' ));
404
-
405
- $ cached_date = get_transient ($ cache_key );
406
- if ($ cached_date !== false ) {
404
+ $ cached_date = get_transient ( $ cache_key );
405
+ if ( false !== $ cached_date ) {
407
406
return $ cached_date ;
408
407
}
409
408
@@ -427,7 +426,8 @@ protected function get_formatted_datetime(
427
426
$ date = wp_date ( $ format , $ ts , $ tz );
428
427
}
429
428
430
- set_transient ($ cache_key , $ date , 43200 );
429
+ set_transient ( $ cache_key , $ date , HOUR_IN_SECONDS * 12 );
430
+
431
431
return (string ) $ date ;
432
432
}
433
433
@@ -877,7 +877,7 @@ public function save_datetimes( array $params ): bool {
877
877
$ retval = false ;
878
878
$ fields = array_filter (
879
879
$ params ,
880
- function ( $ key ) {
880
+ function ( $ key ) {
881
881
return in_array (
882
882
$ key ,
883
883
array (
0 commit comments