Tutorial by Examples

Sometimes we have another editor somewhere else instead of TinyMCE (Wordpress Default Editor). That happen when we are creating our own Theme, Plugin or something specific; and we need to write and manipulate a type of post and save it into our WP Database. So, if you are on that situation, you can...
$basic_post_args = array( 'post_title' => 'My Basic Post', 'post_content' => 'This is a basic content', 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array(8, 59) ); wp_insert_post( $basic_post_args );
$basic_page_args = array( 'post_title' => 'My Basic Page', 'post_content' => 'This is a basic content', 'post_type' => 'page', 'post_status' => 'publish', 'post_author' => 1 ); wp_insert_post( $basic_page_args );

Page 1 of 1