mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Use connection tab when no tab specified and not onboarded
This commit is contained in:
parent
7002c2e6d3
commit
b717af3a1d
1 changed files with 7 additions and 0 deletions
|
@ -169,6 +169,13 @@ return array(
|
|||
$section = isset( $_GET['section'] ) ? sanitize_text_field( wp_unslash( $_GET['section'] ) ) : '';
|
||||
$ppcp_tab = isset( $_GET[ SectionsRenderer::KEY ] ) ? sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) ) : '';
|
||||
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
assert( $state instanceof State );
|
||||
|
||||
if ( ! $ppcp_tab && PayPalGateway::ID === $section && $state->current_state() !== State::STATE_ONBOARDED ) {
|
||||
return Settings::CONNECTION_TAB_ID;
|
||||
}
|
||||
|
||||
return $ppcp_tab ? $ppcp_tab : $section;
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue