getCacheKey($input); return get_transient($cacheKey); } /** * Set the cached result for the given input. * * @param string $input * @param mixed $result * @param int $expiration Expiration time for the cache in seconds. * * @return bool */ public function setCachedResult($input, $result, $expiration = DAY_IN_SECONDS) { $cacheKey = $this->getCacheKey($input); return set_transient($cacheKey, $result, $expiration * 24); } /** * Clear the cached result for the given query. * * @param string $query * * @return bool */ public function clearCache($query) { $cacheKey = $this->getCacheKey($query); return delete_transient($cacheKey); } }