Add filter to save_payment_method_checkbox
Allow the save payment method checkbox to be removed based on payment gateway settings.
This commit is contained in:
parent
7f12c4e436
commit
163795b2ab
|
@ -516,7 +516,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
*/
|
*/
|
||||||
public function save_payment_method_checkbox() {
|
public function save_payment_method_checkbox() {
|
||||||
printf(
|
$html = sprintf(
|
||||||
'<p class="form-row woocommerce-SavedPaymentMethods-saveNew">
|
'<p class="form-row woocommerce-SavedPaymentMethods-saveNew">
|
||||||
<input id="wc-%1$s-new-payment-method" name="wc-%1$s-new-payment-method" type="checkbox" value="true" style="width:auto;" />
|
<input id="wc-%1$s-new-payment-method" name="wc-%1$s-new-payment-method" type="checkbox" value="true" style="width:auto;" />
|
||||||
<label for="wc-%1$s-new-payment-method" style="display:inline;">%2$s</label>
|
<label for="wc-%1$s-new-payment-method" style="display:inline;">%2$s</label>
|
||||||
|
@ -524,6 +524,8 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
|
||||||
esc_attr( $this->id ),
|
esc_attr( $this->id ),
|
||||||
esc_html__( 'Save to account', 'woocommerce' )
|
esc_html__( 'Save to account', 'woocommerce' )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
echo apply_filters( 'woocommerce_payment_gateway_save_new_payment_method_option_html', $html, $this );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue