Viewing 3 replies - 1 through 3 (of 3 total)
  • add_filter('woocommerce_default_address_fields', override_address_fields');
    function override_address_fields( $address_fields ) {
      $address_fields['address_1']['placeholder'] = '';
      $address_fields['address_2']['placeholder'] = '';
      $address_fields['city']['placeholder'] = '';
      $address_fields['state']['placeholder'] = '';
      $address_fields['postcode']['placeholder'] = '';
      return $address_fields;
    }

    More info and any fields I missed are here:
    https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    Thread Starter danina84

    (@danina84)

    Hi,
    I put in in my functions file, however, the same thing happened: I could not view my site any longer! The same thing had happened with the code I used before. When I tried to view my page, it just shows a blank page…

    There’s a typo in the example code, which would have caused a syntax error. The fix is to add a quote before override_address_fields:

    REMOVE THIS
    add_filter(‘woocommerce_default_address_fields’, override_address_fields’);

    ADD THIS:
    add_filter(‘woocommerce_default_address_fields’, ‘override_address_fields’);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove placeholder texts in checkout fields’ is closed to new replies.