Tribe__Events__Aggregator__API__Origins::get_data( string|null $key )
Gets the data for an internal Origins data key.
Contents
The result might be cached from a previous request.
Parameters
- $key
-
(string|null) (Required) The key to fetch the data for.
Return
(mixed|object|bool) The data associated with the key if any and available, false otherwise.
Source
File: src/Tribe/Aggregator/API/Origins.php
public function get_data( $key ) {
if ( null === $key ) {
return $this->fetch_origin_data();
}
$data = get_transient( "{$this->cache_group}_origin_{$key}" );
$cached_version = isset( $data->version ) ? $data->version : '1.0.0';
if ( ! version_compare( $cached_version, static::VERSION, '=' ) ) {
$origin_data = $this->fetch_origin_data();
$data = ! empty( $origin_data->{$key} ) ? $origin_data->{$key} : false;
}
return $data;
}
Changelog
| Version | Description |
|---|---|
| 4.9.6 | Introduced. |