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:
Andrew Benbow 2018-11-08 09:15:18 +00:00 committed by GitHub
parent 7f12c4e436
commit 163795b2ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -516,7 +516,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
* @since 2.6.0
*/
public function save_payment_method_checkbox() {
printf(
$html = sprintf(
'<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;" />
<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_html__( 'Save to account', 'woocommerce' )
);
echo apply_filters( 'woocommerce_payment_gateway_save_new_payment_method_option_html', $html, $this );
}
/**