the answer for all question about Oxygen Builder plugin and WordPress

Okay last question today I promise!


Okay last question today I promise!
I have a function that redirects to homepage after successful logout on the front end.
This works fine on a single WP install, however I have a multisite install and when a user logs out of that particular subsite they should be redirected to the subsite homepage and not the main site homepage.
Here is the original code
add_action(‘wp_logout’,’auto_redirect_after_logout’);

function auto_redirect_after_logout(){
wp_safe_redirect( home_url() );
exit;
}

I can see form a few Google searches that the following needs to be implemented but just not sure how
get_blog_info(‘url’)

I have tried
add_action(‘wp_logout’,’auto_redirect_after_logout’);

function auto_redirect_after_logout(){
wp_safe_redirect( get_blog_info(‘url’) );
exit;
}

but no joy here.
Thanks


Source

2 Comments
  1. Jimmy Galvan says

    Im an absolute beginer but have you tried to declare it as a variable like
    $blog_url = get_blog_info(‘url’);

  2. Paul Knowler says

    Maybe trying echoing the result of the get_blog_info(“url”) to see what is being returned?

Leave A Reply

Your email address will not be published.