Skip to content

Instantly share code, notes, and snippets.

@cpaul007
Created December 7, 2020 10:42
Show Gist options
  • Save cpaul007/3cd0dbcba6e4c2eb5fb137aab803fb4f to your computer and use it in GitHub Desktop.
Save cpaul007/3cd0dbcba6e4c2eb5fb137aab803fb4f to your computer and use it in GitHub Desktop.
Changing the placeholder text of coupon input field
<?php
add_filter( 'gettext_woocommerce', 'ouwoo_coupon_placeholder_text', 10, 3);
function ouwoo_coupon_placeholder_text( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'Enter coupon code' :
$translated_text = "ENTER YOUR TEXT HERE";
break;
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment