Automattic\WooCommerce\Blocks\Patterns
PTKPatternsStore::flush_or_fetch_patterns
Resets the cached patterns when the woocommerce_allow_tracking option is disabled. Resets and fetch the patterns from the PTK when it is enabled (if the scheduler is initialized, it's done asynchronously via a scheduled action).
Method of the class: PTKPatternsStore{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$PTKPatternsStore = new PTKPatternsStore(); $PTKPatternsStore->flush_or_fetch_patterns();
PTKPatternsStore::flush_or_fetch_patterns() PTKPatternsStore::flush or fetch patterns code WC 9.8.5
public function flush_or_fetch_patterns() { if ( $this->allowed_tracking_is_enabled() ) { $this->schedule_fetch_patterns(); return; } $this->flush_cached_patterns(); }