Skip to content

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

@forjoyilive

Description

@forjoyilive

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions