이 시도 woocommerce_save_account_details_errors 할 수 있습니다.
add_filter('woocommerce_process_myaccount_field_{your_custom_field_name}' , 'validate_edit_address');
function validate_edit_address() {
$variable = $_POST['your_custom_field_name'];
if (preg_match("/[ก-๙a-zA-Z]+$/", $variable)){
wc_add_notice(__('<strong>Error</strong>'), 'error');
}
return $variable ;
}
예 :
add_filter('woocommerce_process_myaccount_field_billing_house_number' , 'validate_edit_address');
function validate_edit_address() {
$variable = $_POST['billing_house_number'];
if (preg_match("/[ก-๙a-zA-Z]+$/", $variable)){
wc_add_notice(__('<strong>Error</strong>'), 'error');
}
return $variable ;
}
당신이 필터와 액션을 사용하여 필드를 추가 했습니까? http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ – topdown