Automattic\WooCommerce\Blocks\Patterns

PTKPatternsStore::schedule_fetch_patternsprivateWC 1.0

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() code WC 9.9.3

private function schedule_fetch_patterns() {
	if ( did_action( 'action_scheduler_init' ) ) {
		$this->schedule_action_if_not_pending( 'fetch_patterns' );
	} else {
		add_action(
			'action_scheduler_init',
			function () {
				$this->schedule_action_if_not_pending( 'fetch_patterns' );
			}
		);
	}
}