WordPress.org

Make WordPress Core

Changeset 19077


Ignore:
Timestamp:
10/28/2011 07:52:14 PM (7 years ago)
Author:
ryan
Message:

Avoid undefined index notices. Props SergeyBiryukov, valendesigns. fixes #18455

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r19065 r19077  
    28172817    foreach ( $term_ids as $term_id ) {
    28182818        $child = $term_id;
    2819         while ( $parent = $terms_by_id[$child]->parent ) {
    2820             if ( !empty($term_items[$term_id]) )
     2819        while ( !empty( $terms_by_id[$child] ) && $parent = $terms_by_id[$child]->parent ) {
     2820            if ( !empty( $term_items[$term_id] ) )
    28212821                foreach ( $term_items[$term_id] as $item_id => $touches ) {
    28222822                    $term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1;
Note: See TracChangeset for help on using the changeset viewer.