mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Allow button renderer hook to be filtered
This commit is contained in:
parent
c3405cb464
commit
fb32cec67b
1 changed files with 11 additions and 1 deletions
|
@ -360,7 +360,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
);
|
||||
}
|
||||
|
||||
add_action( 'woocommerce_review_order_after_payment', array( $this, 'button_renderer' ), 10 );
|
||||
add_action( $this->checkout_button_renderer_hook(), array( $this, 'button_renderer' ), 10 );
|
||||
add_action( 'woocommerce_pay_order_after_submit', array( $this, 'button_renderer' ), 10 );
|
||||
|
||||
return true;
|
||||
|
@ -963,4 +963,14 @@ class SmartButton implements SmartButtonInterface {
|
|||
|
||||
return $height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return action name PayPal buttons will be rendered at.
|
||||
*
|
||||
* @return string Action name.
|
||||
*/
|
||||
private function checkout_button_renderer_hook(): string
|
||||
{
|
||||
return (string) apply_filters('woocommerce_paypal_payments_checkout_button_renderer_hook', 'woocommerce_review_order_after_payment');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue