Avoid undefined index notices. Props SergeyBiryukov, valendesigns. fixes #18455
git-svn-id: http://svn.automattic.com/wordpress/trunk@19077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c3bcc9800e
commit
39dc973965
|
@ -2816,7 +2816,7 @@ function _pad_term_counts(&$terms, $taxonomy) {
|
||||||
// Touch every ancestor's lookup row for each post in each term
|
// Touch every ancestor's lookup row for each post in each term
|
||||||
foreach ( $term_ids as $term_id ) {
|
foreach ( $term_ids as $term_id ) {
|
||||||
$child = $term_id;
|
$child = $term_id;
|
||||||
while ( $parent = $terms_by_id[$child]->parent ) {
|
while ( !empty( $terms_by_id[$child] ) && $parent = $terms_by_id[$child]->parent ) {
|
||||||
if ( !empty( $term_items[$term_id] ) )
|
if ( !empty( $term_items[$term_id] ) )
|
||||||
foreach ( $term_items[$term_id] as $item_id => $touches ) {
|
foreach ( $term_items[$term_id] as $item_id => $touches ) {
|
||||||
$term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1;
|
$term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1;
|
||||||
|
|
Loading…
Reference in New Issue