Found it – the trick is to include wp-load.php and then everything works. I was including wp-admin.php and wp-post.php, which is not right.
Thanks, Cosmonaut!
Thanks, Cosmonaut. Which WP files are you including before the call to wp_insert_post?
No, no joy on changing either of those things. No draft, no nothin’
I added some code to check the result of the WP_Error returned from wp_insert_post but there’s no error. And nothing in the wp_posts table, either.
I can’t be the only guy in the world who wants to create WP pages automatically…