mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Enable local apms setting by default on new installations
This commit is contained in:
parent
0795abfb21
commit
42192ede97
3 changed files with 14 additions and 2 deletions
|
@ -783,7 +783,7 @@ return array(
|
|||
'desc_tip' => true,
|
||||
'label' => __( 'Moves the alternative payment methods from the PayPal gateway into their own dedicated gateways.', 'woocommerce-paypal-payments' ),
|
||||
'description' => __( 'By default, alternative payment methods are displayed in the Standard Payments payment gateway. This setting creates a gateway for each alternative payment method.', 'woocommerce-paypal-payments' ),
|
||||
'default' => true,
|
||||
'default' => false,
|
||||
'screens' => array(
|
||||
State::STATE_START,
|
||||
State::STATE_ONBOARDED,
|
||||
|
|
|
@ -497,6 +497,18 @@ class WCGatewayModule implements ModuleInterface {
|
|||
return $fields;
|
||||
}
|
||||
);
|
||||
|
||||
add_action(
|
||||
'woocommerce_paypal_payments_gateway_migrate',
|
||||
function( string $installed_plugin_version ) use ( $c ) {
|
||||
$settings = $c->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof ContainerInterface );
|
||||
|
||||
if ( ! $installed_plugin_version && $settings->has( 'allow_local_apm_gateways' ) ) {
|
||||
$settings->set( 'allow_local_apm_gateways', true );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -106,7 +106,7 @@ define( 'PPCP_PAYPAL_BN_CODE', 'Woo_PPCP' );
|
|||
/**
|
||||
* The hook fired when the plugin is installed or updated.
|
||||
*/
|
||||
do_action( 'woocommerce_paypal_payments_gateway_migrate' );
|
||||
do_action( 'woocommerce_paypal_payments_gateway_migrate', $installed_plugin_version );
|
||||
|
||||
if ( $installed_plugin_version ) {
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue