@pat-j比我快了一分钟,但我会详细说明你也可以使用reg-ex:
add_filter( \'validate_username\', \'wpse257667_check_username\', 10, 2 );
function wpse257667_check_username( $valid, $username ) {
if($valid){
$matches = null;
$returnValue = preg_match(\'/(admin)/i\', $username, $matches);
return empty($matches) ? true : false;
}
}