Skip to content

Simply Computing

We make websites. Simple.

Redirect to front end after user login

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', 'sc_woo_login_redirect', 10, 3);

function sc_woo_login_redirect($redirect_to, $request, $user) {

  return home_url('index.php');

}
	
View Raw Code ID: 91055
  • Home
  • Contact us
  • Payments
  • GeneratePress Hooks
  • WooCommerce Template Hooks
  • WooCommerce Snippets
  • Github Desktop

Simply Computing is administered by Jack and Alan Coggins, and is based in the Blue Mountains area near Sydney, NSW, Australia.

Talk to us

© 2021 Simply Computing