Skip to content

Commit

Permalink
Merge pull request #3063 from woocommerce/PCP-4185-cache-control-for-…
Browse files Browse the repository at this point in the history
…testing

Cache control for testing (4185)
  • Loading branch information
Dinamiko authored Feb 6, 2025
2 parents 606c1e2 + f97e460 commit 99e8fab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/ppcp-settings/src/Service/ConnectionUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,15 @@ protected function try_get_from_cache( OnboardingUrl $onboarding_url, string $ca
if ( $onboarding_url->load() ) {
$this->logger->debug( 'Loaded onboarding URL from cache: ' . $cache_key );

return $onboarding_url->get();
/**
* Filters the cached onboarding URL. Used for cache control
* when testing or development.
*/
return apply_filters(
'woocommerce_paypal_payments_cached_onboarding_url',
$onboarding_url->get(),
$onboarding_url
);
}
} catch ( Exception $e ) {
// No problem, return an empty string to generate a new URL.
Expand Down

0 comments on commit 99e8fab

Please sign in to comment.