//Redirect My Account and Edit Address to Orders tab add_action('template_redirect', 'wish_custom_redirect_extended'); function wish_custom_redirect_extended() { global $wp, $wp_query; if (!is_user_logged_in() && ('my-account' == $wp->request) || ('my-account/edit-address' == $wp->request)) { wp_safe_redirect(site_url('my-account/orders')); exit; } }
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