Automattic\WooCommerce\Blocks\Patterns

AIPatterns::schedule_patterns_content_updatepublicWC 1.0

Update the patterns content when the store description is changed.

Method of the class: AIPatterns{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

AIPatterns::schedule_patterns_content_update() code WC 9.8.5

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 ) );
}