Automattic\WooCommerce\Blocks

BlockPatterns::schedule_patterns_content_update()publicWC 1.0

Update the patterns content when the store description is changed.

Method of the class: BlockPatterns{}

No Hooks.

Return

null. Nothing (null).

Usage

$BlockPatterns = new BlockPatterns();
$BlockPatterns->schedule_patterns_content_update( $business_description );
$business_description(string) (required)
The business description.

BlockPatterns::schedule_patterns_content_update() code WC 9.0.1

public function schedule_patterns_content_update( $business_description ) {
	if ( ! class_exists( 'WooCommerce' ) ) {
		return;
	}

	$action_scheduler = WP_PLUGIN_DIR . '/woocommerce/packages/action-scheduler/action-scheduler.php';

	if ( ! file_exists( $action_scheduler ) ) {
		return;
	}

	require_once $action_scheduler;

	as_schedule_single_action( time(), 'woocommerce_update_patterns_content', array( $business_description ) );
}