mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Merge pull request #794 from woocommerce/pcp-355-hide-gateways
Hide additional gateways when not onboarded or not available
This commit is contained in:
commit
5a5ebd0e58
4 changed files with 53 additions and 17 deletions
|
@ -142,11 +142,15 @@ return array(
|
|||
$settings = $container->get( 'wcgateway.settings' );
|
||||
return new DisableGateways( $session_handler, $settings );
|
||||
},
|
||||
|
||||
'wcgateway.is-wc-payments-page' => static function ( ContainerInterface $container ): bool {
|
||||
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
|
||||
$tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
|
||||
return 'wc-settings' === $page && 'checkout' === $tab;
|
||||
},
|
||||
'wcgateway.is-wc-gateways-list-page' => static function ( ContainerInterface $container ): bool {
|
||||
return $container->get( 'wcgateway.is-wc-payments-page' ) && ! isset( $_GET['section'] );
|
||||
},
|
||||
|
||||
'wcgateway.is-ppcp-settings-page' => static function ( ContainerInterface $container ): bool {
|
||||
if ( ! $container->get( 'wcgateway.is-wc-payments-page' ) ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue