Automattic\WooCommerce\Blocks\Patterns
PTKPatternsStore::schedule_fetch_patterns
Schedule an async action to fetch the PTK patterns when the scheduler is initialized.
Method of the class: PTKPatternsStore{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->schedule_fetch_patterns();
PTKPatternsStore::schedule_fetch_patterns() PTKPatternsStore::schedule fetch patterns code WC 10.8.1
private function schedule_fetch_patterns() {
if ( did_action( 'action_scheduler_init' ) ) {
$this->schedule_action_if_not_pending( self::FETCH_PATTERNS_ACTION );
} else {
add_action(
'action_scheduler_init',
function () {
$this->schedule_action_if_not_pending( self::FETCH_PATTERNS_ACTION );
}
);
}
}