0
votes
1answer
41 views

What's the safest way to switch and restore a post global?

I need to switch WordPress's post context, sort of like switch_to_blog() but for posts. What's the safest way to alter WordPress's global state and switch it back?