Users often only login to the site to edit a page or product, and this is most easily done from the front end by visiting the specific page or product, then selecting the edit option in the top menu. This code snippet redirects the user to the front end on login. The actual page url can be specified.
/**
* Redirect to front end after login
*/
add_filter('login_redirect', 'cc_login_redirect', 10, 3);
function cc_login_redirect($redirect_to, $request, $user) {
return home_url('index.php');
}
View Raw
Code ID: 91055