Answers for "wp php redirect my account page url to custom url"

PHP
0

wp php redirect my account page url to custom url

function custom_redirect() {
    global $wp;

    if( $wp->request == 'my-account' ) {
        wp_redirect( site_url( 'my-account/orders/' ) );
        exit;
    }
}

add_action ('template_redirect', 'custom_redirect');
Posted by: Guest on October-18-2021

Browse Popular Code Answers by Language