• HI All,
    i am using wp_insert_post() in which i am setting post_status=’future’
    but it is not working. it inserts the value publish in database not future. here is my code

    $post_insert=array(
    				'post_author'=>$author,
    				'post_date'=>$date,
    				'post_date_gmt'=>$date1,
    				'post_content'=>$content,
    				'post_title'=>$title,
    				'post_excerpt'=>$excerpt,
    				'post_status'=>'future');
    wp_insert_post($post_insert);

    any one help please

Viewing 1 replies (of 1 total)
  • I was having the same problem and found out something just by reading your post, its about the “post_date_gmt” field, you must ensure you are setting that tvalue properly since that’s the value that the codex takes to compare and then publish, so if its wrong or zero, your post will be published directly.

    It worked for me.
    cheers

Viewing 1 replies (of 1 total)
  • The topic ‘wp_insert_post’ is closed to new replies.