Cut and Paste this code and add it to your root folder.
When run it will create a new post!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php require('./wp-blog-header.php'); $my_post = array(); $my_post['post_title'] = 'My post'; $my_post['post_content'] = 'This is my post.'; $my_post['post_status'] = 'publish'; $my_post['post_author'] = 1; $my_post['post_category'] = array(52); wp_insert_post( $my_post, $wp_error ); echo "New post added"; ?> |