我已经验证了注册表中的自定义字段,我读取了wordpress的codex,所以我自己也是这样做的。但我发现它会抛出像这样的错误
Call to a member function add() on a non-object I don\'t know why this should happen. How can i overcome this.
Code:
function myplugin_check_fields($errors, $sanitized_user_login, $user_email) {
$errors->add( \'demo_error\', __(\'<strong>ERROR</strong>: This is a demo error. Registration halted.\',\'mydomain\') );
return $errors;
}
add_filter(\'registration_errors\', \'myplugin_check_fields\', 10, 3);