Use update and insert. Props DD32. fixes #6836

git-svn-id: https://develop.svn.wordpress.org/trunk@12652 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-07 20:13:54 +00:00
parent 7e6f603296
commit 7b580bf8e8
6 changed files with 17 additions and 21 deletions
+1 -1
View File
@@ -1776,7 +1776,7 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
// catch and repair bad pages
if ( $page->post_parent == $page->ID ) {
$page->post_parent = 0;
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
$wpdb->update($wpdb->posts, array('post_parent' => 0), array('ID' => $page->ID));
clean_page_cache( $page->ID );
}