Make WordPress Core

Ticket #10015: #10015.diff

File #10015.diff, 1.2 KB (added by arena, 16 years ago)

patch

  • wp-admin/includes/template.php

     
    7171                // If the page starts in a subtree, print the parents.
    7272                if ( $count == $start && $category->parent > 0 ) {
    7373
    74                         $my_parents = array();
    75                         $p = $category->parent;
    76                         while ( $p ) {
    77                                 $my_parent = get_category( $p );
     74                        $my_parents = array();
     75                        $my_parent = $category->parent;
     76                        do
     77                        {
     78                                $my_parent = get_category( $my_parent );
    7879                                $my_parents[] = $my_parent;
    79                                 if ( $my_parent->parent == 0 )
    80                                         break;
    81                                 $p = $my_parent->parent;
     80                                $my_parent = $my_parent->parent;
    8281                        }
     82                        while ($my_parent);
    8383
    84                         $num_parents = count($my_parents);
     84                        $num_parents = $plevel = count($my_parents);
    8585                        while( $my_parent = array_pop($my_parents) ) {
    86                                 echo "\t" . _cat_row( $my_parent, $level - $num_parents );
     86                                echo "\t" . _cat_row( $my_parent, $plevel - $num_parents );
    8787                                $num_parents--;
    8888                        }
     89                        echo "\t" . _cat_row( $category, $plevel );
     90                        unset( $categories[ $key ] );
     91                        $count++;
     92
     93                        continue;
    8994                }
    9095
    9196                if ( $count >= $start )