I have network of sites, and I need to import data into them via a cron job. Obviously wp_insert_post is meaningless in this case, since i'm not in a blog...i'm in a cron script.
I also read that switch_to_blog is deprecated, yet I can't find any alternative.
How do I set the blog to post to?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
switch_to_blog isn't deprecated anymore. You can use it just fine. However, it does have a bit of overhead, so you want to use it as little as possible. |
|||
|
|
|
Actually the solution is much easier than this.... |
|||
|
|