Skip to content

Commit

Permalink
Merge pull request #392 from newfold-labs/fix/onboarding-flow
Browse files Browse the repository at this point in the history
Fix onboarding flow
  • Loading branch information
wpscholar authored Dec 12, 2023
2 parents 7a11320 + 17a103d commit 4653bfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions includes/LoginRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public static function filter_redirect( $original_redirect, $user ) {
if ( '0' === $redirect_option ) {
return $original_redirect;
} elseif ( '1' === $redirect_option ) {
// Redirect to onboarding and, disable the redirect via option for any subsequent logins that may occur later.
self::disable_redirect();
return admin_url( '/index.php?page=' . WP_Admin::$slug );
}

Expand All @@ -84,8 +82,7 @@ public static function filter_redirect( $original_redirect, $user ) {
return $original_redirect;
}

// Redirect to onboarding and, disable the redirect via option for any subsequent logins that may occur later.
self::disable_redirect();
// Redirect to onboarding
return admin_url( '/index.php?page=' . WP_Admin::$slug );
}

Expand Down
3 changes: 3 additions & 0 deletions includes/RestApi/FlowController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace NewfoldLabs\WP\Module\Onboarding\RestApi;

use NewfoldLabs\WP\Module\Onboarding\Data\Options;
use NewfoldLabs\WP\Module\Onboarding\Permissions;
use NewfoldLabs\WP\Module\Onboarding\Data\Services\FlowService;
use NewfoldLabs\WP\Module\Onboarding\Services\PluginService;
Expand Down Expand Up @@ -109,6 +110,8 @@ public function get() {
public function save_onboarding_flow_data( \WP_REST_Request $request ) {
$params = json_decode( $request->get_body(), true );

update_option( Options::get_option_name( 'redirect' ), '0' );

$flow_data = FlowService::update_data( $params );
if ( is_wp_error( $flow_data ) ) {
return $flow_data;
Expand Down

0 comments on commit 4653bfc

Please sign in to comment.