// After login, redirect to a specific page add_filter( 'woocommerce_login_redirect', 'woocommerce_customer_login_redirect', 9999, 2 ); function woocommerce_customer_login_redirect( $redirect, $user ) { if ( wc_user_has_role( $user, 'customer' ) ) { $redirect = get_home_url(); // 홈페이지, homepage //$redirect = wc_get_page_permalink( 'shop' ); // 상점 페이지, shop page //$redirect = '/custom_url'; // 동일 사이트 내의 커스텀 URL, custom URL same site //$redirect = 'https://custom.url'; // 다른 사이트의 커스텀 URL, custom URL other site //$redirect = add_query_arg( 'password-reset', 'true', wc_get_page_permalink( 'myaccount' ) ); // 커스텀 내 계정 탭, custom My Account tab } return $redirect; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter