mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
🐛 Load button preview JS on ACDC settings page
Renamed the DI service name; this service is only used in two places (APM modules), which were also updated.
This commit is contained in:
parent
ebb1f6962f
commit
d69fb5bc70
3 changed files with 18 additions and 5 deletions
|
@ -205,7 +205,7 @@ class ApplepayModule implements ModuleInterface {
|
||||||
add_action(
|
add_action(
|
||||||
'admin_enqueue_scripts',
|
'admin_enqueue_scripts',
|
||||||
static function () use ( $c, $button ) {
|
static function () use ( $c, $button ) {
|
||||||
if ( ! is_admin() || ! $c->get( 'wcgateway.is-ppcp-settings-standard-payments-page' ) ) {
|
if ( ! is_admin() || ! $c->get( 'wcgateway.is-ppcp-settings-payment-methods-page' ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ class GooglepayModule implements ModuleInterface {
|
||||||
add_action(
|
add_action(
|
||||||
'admin_enqueue_scripts',
|
'admin_enqueue_scripts',
|
||||||
static function () use ( $c, $button ) {
|
static function () use ( $c, $button ) {
|
||||||
if ( ! is_admin() || ! $c->get( 'wcgateway.is-ppcp-settings-standard-payments-page' ) ) {
|
if ( ! is_admin() || ! $c->get( 'wcgateway.is-ppcp-settings-payment-methods-page' ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,9 +201,22 @@ return array(
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
'wcgateway.is-ppcp-settings-standard-payments-page' => static function ( ContainerInterface $container ): bool {
|
// Checks, if the current admin page contains settings for this plugin's payment methods.
|
||||||
return $container->get( 'wcgateway.is-ppcp-settings-page' )
|
'wcgateway.is-ppcp-settings-payment-methods-page' => static function ( ContainerInterface $container ) : bool {
|
||||||
&& $container->get( 'wcgateway.current-ppcp-settings-page-id' ) === PayPalGateway::ID;
|
if ( ! $container->get( 'wcgateway.is-ppcp-settings-page' ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$active_tab = $container->get( 'wcgateway.current-ppcp-settings-page-id' );
|
||||||
|
|
||||||
|
return in_array(
|
||||||
|
$active_tab,
|
||||||
|
array(
|
||||||
|
PayPalGateway::ID,
|
||||||
|
CreditCardGateway::ID,
|
||||||
|
),
|
||||||
|
true
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
'wcgateway.current-ppcp-settings-page-id' => static function ( ContainerInterface $container ): string {
|
'wcgateway.current-ppcp-settings-page-id' => static function ( ContainerInterface $container ): string {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue