mirror of
https://ghproxy.net/https://github.com/fairpm/fair-plugin.git
synced 2025-09-04 08:50:35 +08:00
use transient because Colin doesn't think people use persistent caching
Signed-off-by: Andy Fragen <andy@thefragens.com>
This commit is contained in:
parent
f8355c7b29
commit
185cf1b2ed
1 changed files with 2 additions and 2 deletions
|
@ -84,13 +84,13 @@ function get_community_events_ajax() : void {
|
|||
* @return array|WP_Error List of events or WP_Error on failure.
|
||||
*/
|
||||
function get_community_events() {
|
||||
$response = wp_cache_get( EVENTS_API );
|
||||
$response = get_transient( EVENTS_API );
|
||||
if ( ! $response ) {
|
||||
$response = wp_remote_get( EVENTS_API );
|
||||
if ( is_wp_error( $response ) ) {
|
||||
return $response;
|
||||
}
|
||||
wp_cache_set( EVENTS_API, $response, '', CACHE_LIFETIME );
|
||||
set_transient( EVENTS_API, $response, CACHE_LIFETIME );
|
||||
}
|
||||
|
||||
$data = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue