Code-Snippets-Functions/Execute a function on a child site/WooCommerce/set-billing-first-last-name-read-only.txt

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;
}