Working Login redirect to profile snippet ?
-
In an effort to reduce the number of plugins I am running I am trying to get a code based login redirect working. I tried using this snippet
<?php /*Add a filter to filter the redirect url for login*/ add_filter("login_redirect","bpdev_redirect_to_profile",100,3); function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user) { /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/ if(empty($redirect_to_calculated)) $redirect_to_calculated=admin_url(); /*if the user is not site admin,redirect to his/her profile*/ if(!is_site_admin($user->user_login)) return bp_core_get_user_domain($user->ID).mypics; else return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/ } ?>
But it doesn’t work it returns an error unexpected < every time. I have been working through many snippets which are supposed to work but none do. I am just a bit over my head here as I am not sure what each of the functions do.
If anyone can point me in the write direction it would be much appreciated.
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Working Login redirect to profile snippet ?’ is closed to new replies.