Skip to content

Instantly share code, notes, and snippets.

View ajaypatelaj's full-sized avatar
🎯
Focusing

Ajay Patel ajaypatelaj

🎯
Focusing
View GitHub Profile
@ajaypatelaj
ajaypatelaj / redirectonrole
Created February 8, 2012 05:45 — forked from viruthagiri/gist:1761124
wordpress redirect on login based on roles
function fs_login($user, $pass) {
$uname = $user;
$pass1 = $pass;
$credentials = array(
'user_login' => $user,
'user_password' => $pass,
'remember' => true
);
$user = wp_signon($credentials, false);
if( $user->ID ){