1 回答
TA贡献1804条经验 获得超3个赞
我找到了一个解决方案,禁用类“form-row”以避免来自 woocommerce 的 js 并添加优先级:
function change_woocommerce_field_markup($field, $key, $args, $value) {
$field = str_replace('form-row', '', $field);
$field = '<div class="single-field-wrapper" data-priority="' . $args['priority'] .
'">' . $field . '</div>';
if($key === 'billing_state')
$field = '<div class="state-province">'.$field;
else if ($key === 'billing_country')
$field = $field.'</div>';
return $field;
}
add_filter("woocommerce_form_field","change_woocommerce_field_markup", 10, 4);
这是解释:https://wordpress.stackexchange.com/questions/309700/how-to-hook-on-a-woocommerce-checkout-field/309788
- 1 回答
- 0 关注
- 72 浏览
添加回答
举报