From a407039467efc13a8504b4d569a4ef079592ffc9 Mon Sep 17 00:00:00 2001 From: Santiago Garza Date: Sat, 29 Jul 2017 01:26:08 -0700 Subject: [PATCH] Removed examples folder --- examples/idx-api-with-cache.php | 51 --------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 examples/idx-api-with-cache.php diff --git a/examples/idx-api-with-cache.php b/examples/idx-api-with-cache.php deleted file mode 100644 index ab0bbda..0000000 --- a/examples/idx-api-with-cache.php +++ /dev/null @@ -1,51 +0,0 @@ -args['method'] ) { - return parent::request(); - } - - // We md5 the route to create a unique key for that call and to also reduce the risk of - // creating a key that is over 64 characters long, aka the max length for option names. - $transient_key = 'idxbroker_cache_' . md5( $this->route ); - - // Check if cache for API call exists. - $request = get_transient( $transient_key ); - - // If nothing is found, make the request. - if ( true === $force_refresh || false === $request ) { - // Parent method handles the request to IDX Broker. - $request = parent::request(); - - if ( false !== $request ) { - set_transient( $transient_key, $request, 2 * HOUR_IN_SECONDS ); - } - } - - return $request; - } - -}