How to change post status from “draft” to “publish”?
A two-part answer below – As above: the broad solution was to save the posts first as draft, then update them with the custom fields and terms, and only then set them to publish. As I said, the above code modification had succeeded in setting the posts to draft but not in transitioning them to … Read more