Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once './wp-load.php';
- $new_post = array(
- 'post_title' => 'My New Post',
- 'post_content' => 'Lorem ipsum dolor sit amet...',
- 'post_status' => 'publish',
- 'post_date' => date('Y-m-d H:i:s'),
- 'post_author' => '3',
- 'post_type' => 'post'
- );
- $post_id = wp_insert_post($new_post);
- var_dump($post_id); die; // Return int(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement