ementation_cache_key(): string { $versions = [ TCMN::VERSION, ]; if ( did_action( 'tec_events_fully_loaded' ) ) { $versions[] = TEC::VERSION; } if ( did_action( 'tec_tickets_fully_loaded' ) ) { $versions[] = ET::VERSION; } if ( did_action( 'tec_tickets_plus_fully_loaded' ) ) { $versions[] = ETP::VERSION; } if ( did_action( 'tec_events_pro_fully_loaded' ) ) { $versions[] = ECP::VERSION; } // Will always be 48 chars. As a result whatever we add here should not be longer than 172 - 48 = 124 chars. return 'tec_rest_' . self::get_versioned_namespace() . '_' . md5( implode( '', $versions ) ); } /** * Returns the cache key for the implementation. * * @since 6.9.0 * * @param string $key The key to add to the cache key. * * @return string * * @throws InvalidArgumentException If the cache key is longer than 123 characters. */ public static function get_cache_key( string $key ): string { if ( strlen( $key ) > 123 ) { throw new InvalidArgumentException( 'The cache key must be less than 123 characters.' ); } return self::get_implementation_cache_key() . '_' . $key; } /** * Returns the cache for the REST API. * * @since 6.9.0 * * @param string $key The key to get the cache for. * * @return mixed */ public static function get_rest_cache( string $key ) { /** @var Cache $cache */ $cache = tribe_cache(); $cache_key = self::get_cache_key( $key ); return wp_using_ext_object_cache() ? $cache->get( $cache_key ) : $cache->get_transient( $cache_key ); } /** * Sets the cache for the REST API. * * @since 6.9.0 * * @param string $key The key to set the cache for. * @param mixed $value The value to set the cache for. * * @return void */ public static function set_rest_cache( string $key, $value ) { /** @var Cache $cache */ $cache = tribe_cache(); $cache_key = self::get_cache_key( $key ); if ( wp_using_ext_object_cache() ) { $cache->set( $cache_key, $value, WEEK_IN_SECONDS ); } else { $cache->set_transient( $cache_key, $value, WEEK_IN_SECONDS ); } } /** * Deletes the cache for the REST API. * * @since 6.9.0 * * @param string $key The key to delete the cache for. * * @return void */ public static function delete_rest_cache( string $key ) { /** @var Cache $cache */ $cache = tribe_cache(); $cache_key = self::get_cache_key( $key ); if ( wp_using_ext_object_cache() ) { $cache->delete( $cache_key ); } else { $cache->delete_transient( $cache_key ); } } /** * Recursively hides the password protected data from the entity. * * @since 6.9.0 * * @param array $data The data to hide the password protected data from. * @param string $post_type The post type of the entity. * * @return mixed */ protected function recursive_hide_password_protected_data( array $data, string $post_type ): array { /** * Filters the whitelisted fields that will not be hidden. * * @since 6.9.0 * * @param array $whitelisted_fields The whitelisted fields. * @param string $post_type The post type of the entity. */ $whitelisted_fields = (array) apply_filters( 'tec_rest_v1_post_password_whitelisted_fields', self::WHITELISTED_FIELDS, $post_type ); foreach ( $data as $key => $value ) { if ( in_array( $key, $whitelisted_fields, true ) ) { continue; } if ( $value instanceof JsonSerializable ) { $value = json_decode( wp_json_encode( $value ), true ); } if ( $value instanceof DateTimeImmutable ) { $value = new DateTimeImmutable( '1970-01-01 00:00:00', new DateTimeZone( 'UTC' ) ); } if ( is_callable( $value ) ) { $data[ $key ] = null; continue; } if ( is_array( $value ) || is_object( $value ) ) { $data[ $key ] = $this->recursive_hide_password_protected_data( (array) $value, $post_type ); continue; } if ( ! is_numeric( $value ) && ! is_string( $value ) ) { $data[ $key ] = null; continue; } $data[ $key ] = is_string( $value ) ? __( 'Password protected', 'tribe-common' ) : 0; } return $data; } } ementation_cache_key(): string { $versions = [ TCMN::VERSION, ]; if ( did_action( 'tec_events_fully_loaded' ) ) { $versions[] = TEC::VERSION; } if ( did_action( 'tec_tickets_fully_loaded' ) ) { $versions[] = ET::VERSION; } if ( did_action( 'tec_tickets_plus_fully_loaded' ) ) { $versions[] = ETP::VERSION; } if ( did_action( 'tec_events_pro_fully_loaded' ) ) { $versions[] = ECP::VERSION; } // Will always be 48 chars. As a result whatever we add here should not be longer than 172 - 48 = 124 chars. return 'tec_rest_' . self::get_versioned_namespace() . '_' . md5( implode( '', $versions ) ); } /** * Returns the cache key for the implementation. * * @since 6.9.0 * * @param string $key The key to add to the cache key. * * @return string * * @throws InvalidArgumentException If the cache key is longer than 123 characters. */ public static function get_cache_key( string $key ): string { if ( strlen( $key ) > 123 ) { throw new InvalidArgumentException( 'The cache key must be less than 123 characters.' ); } return self::get_implementation_cache_key() . '_' . $key; } /** * Returns the cache for the REST API. * * @since 6.9.0 * * @param string $key The key to get the cache for. * * @return mixed */ public static function get_rest_cache( string $key ) { /** @var Cache $cache */ $cache = tribe_cache(); $cache_key = self::get_cache_key( $key ); return wp_using_ext_object_cache() ? $cache->get( $cache_key ) : $cache->get_transient( $cache_key ); } /** * Sets the cache for the REST API. * * @since 6.9.0 * * @param string $key The key to set the cache for. * @param mixed $value The value to set the cache for. * * @return void */ public static function set_rest_cache( string $key, $value ) { /** @var Cache $cache */ $cache = tribe_cache(); $cache_key = self::get_cache_key( $key ); if ( wp_using_ext_object_cache() ) { $cache->set( $cache_key, $value, WEEK_IN_SECONDS ); } else { $cache->set_transient( $cache_key, $value, WEEK_IN_SECONDS ); } } /** * Deletes the cache for the REST API. * * @since 6.9.0 * * @param string $key The key to delete the cache for. * * @return void */ public static function delete_rest_cache( string $key ) { /** @var Cache $cache */ $cache = tribe_cache(); $cache_key = self::get_cache_key( $key ); if ( wp_using_ext_object_cache() ) { $cache->delete( $cache_key ); } else { $cache->delete_transient( $cache_key ); } } /** * Recursively hides the password protected data from the entity. * * @since 6.9.0 * * @param array $data The data to hide the password protected data from. * @param string $post_type The post type of the entity. * * @return mixed */ protected function recursive_hide_password_protected_data( array $data, string $post_type ): array { /** * Filters the whitelisted fields that will not be hidden. * * @since 6.9.0 * * @param array $whitelisted_fields The whitelisted fields. * @param string $post_type The post type of the entity. */ $whitelisted_fields = (array) apply_filters( 'tec_rest_v1_post_password_whitelisted_fields', self::WHITELISTED_FIELDS, $post_type ); foreach ( $data as $key => $value ) { if ( in_array( $key, $whitelisted_fields, true ) ) { continue; } if ( $value instanceof JsonSerializable ) { $value = json_decode( wp_json_encode( $value ), true ); } if ( $value instanceof DateTimeImmutable ) { $value = new DateTimeImmutable( '1970-01-01 00:00:00', new DateTimeZone( 'UTC' ) ); } if ( is_callable( $value ) ) { $data[ $key ] = null; continue; } if ( is_array( $value ) || is_object( $value ) ) { $data[ $key ] = $this->recursive_hide_password_protected_data( (array) $value, $post_type ); continue; } if ( ! is_numeric( $value ) && ! is_string( $value ) ) { $data[ $key ] = null; continue; } $data[ $key ] = is_string( $value ) ? __( 'Password protected', 'tribe-common' ) : 0; } return $data; } }
Fatal error: Uncaught TEC\Common\Exceptions\Not_Bound_Exception: Error while making TEC\Common\REST\TEC\V1\Controller: nothing is bound to the 'TEC\Common\REST\TEC\V1\Controller' id and it's not an existing or instantiable class. in /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php:35 Stack trace: #0 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(425): TEC\Common\Contracts\Container->get('TEC\\Common\\REST...') #1 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(63): TEC\Common\lucatume\DI52\Container->register('TEC\\Common\\REST...') #2 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/REST/Controller.php(42): TEC\Common\Contracts\Container->register('TEC\\Common\\REST...') #3 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Provider/Controller.php(49): TEC\Common\REST\Controller->do_register() #4 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(427): TEC\Common\Contracts\Provider\Controller->register() #5 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(63): TEC\Common\lucatume\DI52\Container->register('TEC\\Common\\REST...') #6 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Controller.php(53): TEC\Common\Contracts\Container->register('TEC\\Common\\REST...') #7 /htdocs/wp-includes/class-wp-hook.php(341): TEC\Common\Controller->load_controllers('') #8 /htdocs/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array) #9 /htdocs/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #10 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Main.php(131): do_action('tribe_common_lo...') #11 /htdocs/wp-includes/class-wp-hook.php(341): Tribe__Main->plugins_loaded('') #12 /htdocs/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array) #13 /htdocs/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #14 /htdocs/wp-settings.php(593): do_action('plugins_loaded') #15 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #16 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #17 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #18 /htdocs/index.php(17): require('/htdocs/wp-blog...') #19 {main} thrown in /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php on line 35