wp_redirect() is a cool way to redir someone based on certain circumstances, like user permissions. So far I have seen this help in two applications.
1. use just the at the top of template file to redirect a page to another page if user is logged in. I.E. – if you want to redirect a logged in user away from this page to another….
if(is_user_logged_in()) { wp_redirect("/member-profile/"); exit(); }
2. use in functions to redirect logged in users to other member page if they are not admins. Then you can hook it in the action of entering the admin (admin_init)
//hook onto dashboard and redirect all non admin to front site add_action('admin_init','redirect_nonadmin_fromdash'); function redirect_nonadmin_fromdash(){ if (!current_user_can('activate_plugins')) { // Edit Line Below For Your Own Redirect wp_redirect("/member-profile/"); exit(); } }