Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

CustomizeStore::mark_task_as_complete()publicWC 1.0

Mark the CYS task as complete whenever the user updates their global styles.

Method of the class: CustomizeStore{}

No Hooks.

Return

null. Nothing (null).

Usage

$CustomizeStore = new CustomizeStore();
$CustomizeStore->mark_task_as_complete( $post_id, $post, $update );
$post_id(int) (required)
Post ID.
$post(\WP_Post) (required)
Post object.
$update(true|false) (required)
Whether this is an existing post being updated.

CustomizeStore::mark_task_as_complete() code WC 9.0.1

public function mark_task_as_complete( $post_id, $post, $update ) {
	if ( $post instanceof \WP_Post ) {
		$is_cys_complete = '{"version": 2, "isGlobalStylesUserThemeJSON": true }' !== $post->post_content || in_array( $post->post_type, array( 'wp_template', 'wp_template_part' ), true );

		if ( $is_cys_complete ) {
			update_option( 'woocommerce_admin_customize_store_completed', 'yes' );
		}
	}
}