Merge pull request #657 from woocommerce/PCP-687-do-not-call-partner-referrals-si

Cache partner referrals signup links
This commit is contained in:
Emili Castells 2022-06-14 15:05:15 +02:00 committed by GitHub
commit 259f824dac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 165 additions and 22 deletions

View file

@ -67,10 +67,11 @@ class Cache {
*
* @param string $key The key under which the value should be cached.
* @param mixed $value The value to cache.
* @param int $expiration Time until expiration in seconds.
*
* @return bool
*/
public function set( string $key, $value ): bool {
return (bool) set_transient( $this->prefix . $key, $value );
public function set( string $key, $value, int $expiration = 0 ): bool {
return (bool) set_transient( $this->prefix . $key, $value, $expiration );
}
}