Use wpdb::insert() and update(). Props DD32. see #6836
git-svn-id: http://svn.automattic.com/wordpress/trunk@10730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -2273,7 +2273,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
if( is_array( $attachments ) ) {
|
||||
foreach( $attachments as $file ) {
|
||||
if( strpos( $post_content, $file->guid ) !== false ) {
|
||||
$wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $post_ID, $file->ID) );
|
||||
$wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user