I am working on WordPress Plugin and want to add scheduled post in my plugin. Can anyone share a sample code for how to do this?
I am using wp_insert_post()
function for add post, I guess I have to modify parameters in this function.
'post_status' => 'future'
I am not sure how to set date and time when the post get published!
Both functions wp_insert_post
and wp_update_post
accepts an array of posts.
And among the parameters, you can set the value of post_date
and post_date_gmt
.