您没有正确使用registration\\u errors挂钩。应该是这样的:
add_filter( \'registration_errors\', \'reg_user_register\', 10, 3);
function reg_user_register($errors, $sanitized_user_login, $user_email){
$custom_reg_field1 = $_POST["custom_reg_field1"];
// add error checking here
if ( empty($custom_reg_field1) ) {
$errors->add(\'custom_reg_field1\', __( \'Please enter a reg_field1.\' ) );
}
return $errors;
}