Make WordPress Core

Ticket #5581: wporg_patch.diff

File wporg_patch.diff, 1.2 KB (added by hailin, 17 years ago)

patch

  • C:/xampp/htdocs/wordpress_trunk/wp-includes/classes.php

     
    434434                               
    435435                                array_splice( $children_elements, $i, 1 );
    436436                                $output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
    437                                 $i--;
     437                                $i = -1;
    438438                        }
    439439                }
    440440               
  • C:/xampp/htdocs/wordpress_trunk/wp-admin/includes/template.php

     
    288288        $children_pages  = array();
    289289
    290290        foreach ( $pages as $page ) {
     291               
     292                // catch and repair bad pages
     293                if ($page->post_parent == $page->ID) {
     294                        $page->post_parent = 0;
     295                        $wpdb->query( "UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = $page->ID"  );
     296                        clean_page_cache( $page->ID );
     297                }
     298                 
    291299                if ( 0 == $page->post_parent )
    292300                        $top_level_pages[] = $page;
    293301                else