我需要更改默认字段,但代码中有一个小错误。正确的代码是:
add_filter( \'woocommerce_default_address_fields\', \'uwc_new_address_one_placeholder\', 1 );
function uwc_new_address_one_placeholder( $address_fields) {
$address_fields[\'address_1\'][\'placeholder\'] = \'Address line 1\';
$address_fields[\'address_2\'][\'placeholder\'] = \'Address line 2\';
return $address_fields;
}
注意更改为
$address_fields
在线3