initialize_coming_soon(); if ( ! $result ) { return new WP_Error( 'initialization_failed', 'Failed to initialize coming soon mode.' ); } // Remove template changes. $template = get_block_template( 'woocommerce/woocommerce//coming-soon', 'wp_template' ); if ( $template && isset( $template->wp_id ) ) { $delete_result = wp_delete_post( $template->wp_id, true ); if ( false === $delete_result ) { return new WP_Error( 'template_deletion_failed', 'Failed to delete the coming soon template.' ); } } // Reset survey completion state. delete_option( 'woocommerce_admin_launch_your_store_survey_completed' ); // Reset essential task list completion tracking. $tasks_completed = get_option( \Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task::COMPLETED_OPTION, array() ); $tasks_completed = array_filter( $tasks_completed, function( $task ) { return 'launch-your-store' !== $task; } ); update_option( \Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task::COMPLETED_OPTION, $tasks_completed ); // Reset setup task list completion tracking. $task_lists_completed = get_option( \Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskList::COMPLETED_OPTION, array() ); $task_lists_completed = array_filter( $task_lists_completed, function( $task_list ) { return 'setup' !== $task_list; } ); update_option( \Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskList::COMPLETED_OPTION, $task_lists_completed ); return true; }