Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active July 20, 2021 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/ddc7b7b1d8fa25f05459920f9c487b00 to your computer and use it in GitHub Desktop.
Save clifgriffin/ddc7b7b1d8fa25f05459920f9c487b00 to your computer and use it in GitHub Desktop.
Change apt field label
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
/**
* CheckoutWC 2.18.0+
*
* Change shipping and billing address 2 label
*/
add_filter( 'woocommerce_default_address_fields', 'custom_override_address2_label', 200000, 1 );
function custom_override_address2_label( $address_fields ) {
$address_fields['address_2']['label'] = $address_fields['address_2']['placeholder'] = 'Apartment Number';
return $address_fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment