Reputation: 1
In my Wordpress site users are unable to do any post. They saved in draft but not publish. Please give any suggestions.
https://codex.wordpress.org/Function_Reference/wp_insert_post
I think wp_insert_post()
is used for posting. I am new in wordpress please help me.
Upvotes: 0
Views: 48
Reputation: 909
Please take look into settings - general and check your timezone! It should be something like UTC+0, NOT e.g. Berlin, Zagreb, etc.
I had the same issue after hours of debugging and at least, I changed the timezone to UTC+0 and it worked.
see also: Wordpress admin cannot publish posts
Upvotes: 1
Reputation: 978
$post = array(
'post_title' => 'post name',
'post_content' => 'This post.',
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array('cat id')
);
wp_insert_post( $post );
Upvotes: 1