Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two posts in a row from the same child set will fire restore_current_blog() inappropriately (fix included) #18

Open
forjoyilive opened this issue Dec 28, 2015 · 0 comments

Comments

@forjoyilive
Copy link

This is great, thank you for creating it. So easy to use.

I was doing a query from the main site in a network and I found that, during a loop, having two posts from the same child site would reset the current blog to the network.

The fix is to replace the "else" in switch_to_blog_while_in_loop() with:

else if ( ! ms_is_switched() )

... that way, if the current blog id is that of a child blog, it will stay there instead of switching back by using restore_current_blog().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant