Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save vishalbasnet23/35d1f4292f212464e9cd to your computer and use it in GitHub Desktop.

Select an option

Save vishalbasnet23/35d1f4292f212464e9cd to your computer and use it in GitHub Desktop.
Redirect to custom page url after successful Login WooCommerce
<?php add_filter('woocommerce_login_redirect', 'wc_login_redirect');
function wc_login_redirect( $redirect_to ) {
$page_slug = 'foo';
$redirect_to = get_permalink( get_page_by_path( $page_slug ) );
return $redirect_to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment