Howdy,
I've tried to modify wp-login.php to redirect the login page to the profile if they're non admins. I'm halfway there. The code below redirects all users to the profile. Will someone tell me where I went wrong?
Thanks!
if ( isset( $_REQUEST['redirect_to'] ) ) {
$redirect_to = $_REQUEST['redirect_to'];
// Redirect to https if user wants ssl
if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
$redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
} else {
<strong>if( current_user_can('administrator') ) {</strong>
$redirect_to = admin_url();
<strong>} else {
$redirect_to = admin_url( 'profile.php' );
}</strong>
}