Reverting [12361] due to logic issue. see #10715

git-svn-id: http://svn.automattic.com/wordpress/trunk@12370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2009-12-10 23:11:54 +00:00
parent e2c408bfbe
commit 929a2cd6cd
1 changed files with 5 additions and 5 deletions

View File

@ -43,9 +43,9 @@ function press_it() {
// define some basic variables // define some basic variables
$quick['post_status'] = 'draft'; // set as draft first $quick['post_status'] = 'draft'; // set as draft first
$quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null; $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
$quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : '';
$quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' '; $quick['post_title'] = isset($_POST['title']) ? $_POST['title'] : '';
$quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : ''; $quick['post_content'] = '';
// insert the post with nothing in it, to get an ID // insert the post with nothing in it, to get an ID
$post_ID = wp_insert_post($quick, true); $post_ID = wp_insert_post($quick, true);
@ -68,12 +68,12 @@ function press_it() {
$quick['post_content'] = $content; $quick['post_content'] = $content;
// error handling for $post // error handling for $post
if ( is_wp_error($post_ID)) { if ( is_wp_error($post_ID)) {
wp_delete_post($post_ID);
wp_die($id); wp_die($id);
wp_delete_post($post_ID);
// error handling for media_sideload // error handling for media_sideload
} elseif ( is_wp_error($upload)) { } elseif ( is_wp_error($upload)) {
wp_delete_post($post_ID);
wp_die($upload); wp_die($upload);
wp_delete_post($post_ID);
} else { } else {
$quick['ID'] = $post_ID; $quick['ID'] = $post_ID;
wp_update_post($quick); wp_update_post($quick);