Merge branch 'master' into fix/25560
# Conflicts: # includes/admin/class-wc-admin-setup-wizard.php
This commit is contained in:
commit
aa8e8992cc
|
@ -498,11 +498,8 @@ class WC_Admin_Setup_Wizard {
|
|||
public function wc_setup_new_onboarding_save() {
|
||||
check_admin_referer( 'wc-setup' );
|
||||
|
||||
update_option( 'wc_onboarding_opt_in', 'yes' );
|
||||
|
||||
if ( $this->is_wc_admin_included_in_wc() ) {
|
||||
$this->wc_setup_redirect_to_wc_admin_onboarding();
|
||||
exit;
|
||||
}
|
||||
|
||||
WC_Install::background_installer(
|
||||
|
@ -520,19 +517,23 @@ class WC_Admin_Setup_Wizard {
|
|||
}
|
||||
|
||||
$this->wc_setup_redirect_to_wc_admin_onboarding();
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirects to the onboarding wizard in WooCommerce Admin.
|
||||
*/
|
||||
private function wc_setup_redirect_to_wc_admin_onboarding() {
|
||||
if ( ! function_exists( 'wc_admin_url' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Renables the wizard.
|
||||
$profile_updates = array( 'completed' => false );
|
||||
$onboarding_data = get_option( 'wc_onboarding_profile', array() );
|
||||
update_option( 'wc_onboarding_profile', array_merge( $onboarding_data, $profile_updates ) );
|
||||
$onboarding_data = get_option( 'woocommerce_onboarding_profile', array() );
|
||||
update_option( 'woocommerce_onboarding_profile', array_merge( $onboarding_data, $profile_updates ) );
|
||||
|
||||
wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-admin' ) ) );
|
||||
wp_safe_redirect( wc_admin_url( '&enable_onboarding=1' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue