From 235afd2f97acdad85e33ec7d090fa190ec496351 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 24 Sep 2009 17:13:11 +0000 Subject: [PATCH] Use a post_parent of 0 instead of -1 to indicate unattached posts. Props c0nstruct. see #10521 git-svn-id: http://svn.automattic.com/wordpress/trunk@11969 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- xmlrpc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmlrpc.php b/xmlrpc.php index b010bfdc69..6a97b83086 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -2282,7 +2282,7 @@ class wp_xmlrpc_server extends IXR_Server { global $wpdb; // find any unattached files - $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '-1' AND post_type = 'attachment'" ); + $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" ); if( is_array( $attachments ) ) { foreach( $attachments as $file ) { if( strpos( $post_content, $file->guid ) !== false ) { @@ -2889,8 +2889,8 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error(500, $errorString); } // Construct the attachment array - // attach to post_id -1 - $post_id = -1; + // attach to post_id 0 + $post_id = 0; $attachment = array( 'post_title' => $name, 'post_content' => '',