• Hi!
    This is my code:

    $my_post = array(
    		'post_title'    => 'My post',
    		'post_content'  => 'This is my post.',
    		'post_category' => array(1),
    		'post_status'   => 'publish',
    		'post_author'   => 1,
    		'post_date' 	=> date('Y-m-d H:i:s'),
    		'post_date_gmt' => date('Y-m-d H:i:s')
    );
    
    // Insert the post into the database
    wp_insert_post( $my_post );

    Why it isn’t works? What’s a problem?

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