From 48771720171876baded151122c23391f26f9b128 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 3 Apr 2024 11:57:14 +0100 Subject: [PATCH] Add filter to hide PayPal email address on order detail page. --- modules/ppcp-wc-gateway/src/WCGatewayModule.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ppcp-wc-gateway/src/WCGatewayModule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php index 4295b1b17..8e765a8e9 100644 --- a/modules/ppcp-wc-gateway/src/WCGatewayModule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -459,6 +459,10 @@ class WCGatewayModule implements ModuleInterface { function ( $fields ) { global $theorder; + if ( ! apply_filters( 'woocommerce_paypal_payments_order_details_show_paypal_email', true ) ) { + return $fields; + } + if ( ! is_array( $fields ) ) { return $fields; }