Add filters for place order button mode and text replacement script

This commit is contained in:
Alex P 2023-11-15 09:44:26 +02:00
parent b2ba72c06c
commit c71e312f18
No known key found for this signature in database
GPG key ID: 54487A734A204D71
7 changed files with 240 additions and 0 deletions

View file

@ -1156,6 +1156,25 @@ return array(
);
},
'wcgateway.use-place-order-button' => function ( ContainerInterface $container ) : bool {
/**
* Whether to use the standard "Place order" button with redirect to PayPal instead of the PayPal smart buttons.
*/
return apply_filters(
'woocommerce_paypal_payments_use_place_order_button',
false
);
},
'wcgateway.place-order-button-text' => function ( ContainerInterface $container ) : string {
/**
* The text for the standard "Place order" button, when the "Place order" button mode is enabled.
*/
return apply_filters(
'woocommerce_paypal_payments_place_order_button_text',
__( 'Pay with PayPal', 'woocommerce-paypal-payments' )
);
},
'wcgateway.helper.vaulting-scope' => static function ( ContainerInterface $container ): bool {
try {
$token = $container->get( 'api.bearer' )->bearer();