mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-03 12:12:25 +08:00
https://stackoverflow.com/questions/73329726/woocommerce-make-name-and-address-fields-read-only
8 lines
328 B
Text
8 lines
328 B
Text
add_filter('woocommerce_billing_fields', 'my_woocommerce_billing_fields');
|
|
function my_woocommerce_billing_fields($fields)
|
|
{
|
|
$fields['billing_first_name']['custom_attributes'] = array('readonly'=>'readonly');
|
|
$fields['billing_last_name']['custom_attributes'] = array('readonly'=>'readonly');
|
|
|
|
return $fields;
|
|
}
|