Make WordPress Core

Ticket #18455: 18455.patch

File 18455.patch, 757 bytes (added by SergeyBiryukov, 14 years ago)
  • wp-includes/taxonomy.php

     
    28032803        // Touch every ancestor's lookup row for each post in each term
    28042804        foreach ( $term_ids as $term_id ) {
    28052805                $child = $term_id;
    2806                 while ( $parent = $terms_by_id[$child]->parent ) {
    2807                         if ( !empty($term_items[$term_id]) )
     2806                while ( !empty( $terms_by_id[$child] ) && $parent = $terms_by_id[$child]->parent ) {
     2807                        if ( !empty( $term_items[$term_id] ) )
    28082808                                foreach ( $term_items[$term_id] as $item_id => $touches ) {
    28092809                                        $term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1;
    28102810                                }