Skip to content

Instantly share code, notes, and snippets.

@VanessaKing
Forked from tharmann/functions.php
Created August 30, 2016 21:14
Show Gist options
  • Save VanessaKing/572c0eecfaf9a745f346d6a1488374e7 to your computer and use it in GitHub Desktop.
Save VanessaKing/572c0eecfaf9a745f346d6a1488374e7 to your computer and use it in GitHub Desktop.
Add a more descriptive tooltip to the CVC field on the WooCommerce order form credit card fields
<?php
//add tooltip to cvc field
function custom_credit_card_fields_cis_cc ($cc_fields , $payment_id){
$cc_fields['card-cvc-field'] = str_replace('<p class="form-row form-row-last">','<p class="form-row form-row-last" title="3-digit security code usually found on the back of your card. American Express cards have a 4-digit code located on the front.">',$cc_fields['card-cvc-field']);
return $cc_fields;
}
add_filter( 'woocommerce_credit_card_form_fields' , 'custom_credit_card_fields_cis_cc' , 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment