daily pastebin goal
35%
SHARE
TWEET

WooCommerce - Make checkout fields readonly

lorro Jul 27th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // WooCommerce - Make checkout fields readonly
  3. add_action( 'woocommerce_checkout_fields', 'readonly_billing_last_name', 10, 1 );
  4. function readonly_billing_last_name( $checkout_fields ) {
  5.   $checkout_fields['billing']['billing_first_name']['custom_attributes'] = array( 'readonly' => 'readonly' );
  6.   $checkout_fields['billing']['billing_last_name']['custom_attributes'] = array( 'readonly' => 'readonly' );
  7.   return $checkout_fields;
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top