function custom_authenticate_username_password($user,$username, $password ) {
global $wpdb;
$table_name =\'users\';
$sql="select * from $table_name where username=\'".$username."\' and password=\'".$password."\'";
$user=$wpdb->get_results($sql);
if(!empty($user)){
echo \'success\';
}
else{
echo \'faliure\';
}
}
remove_filter( \'authenticate\', \'wp_authenticate_username_password\', 20, 3 );
add_filter( \'authenticate\', \'custom_authenticate_username_password\', 20, 3);
这里的users表包含一些用户信息。这些用户不是wp注册用户,但我想为这些用户提供wp\\u admin访问权限。我该怎么做?