Changeset 9961
- Timestamp:
- 06/22/2015 07:17:05 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r9834 r9961 1415 1415 $depth = 1; 1416 1416 $parent_id = $r->secondary_item_id; 1417 1417 1418 while ( $parent_id !== $r->item_id ) { 1418 1419 $depth++; 1419 1420 1420 // When display_comments=stream, the 1421 // parent comment may not be part of 1422 // the returned results, so we manually 1423 // fetch it 1421 // When display_comments=stream, the parent comment may not be part of the 1422 // returned results, so we manually fetch it 1424 1423 if ( empty( $ref[ $parent_id ] ) ) { 1425 1424 $direct_parent = new BP_Activity_Activity( $parent_id ); 1426 1425 if ( isset( $direct_parent->secondary_item_id ) ) { 1427 $parent_id = $direct_parent->secondary_item_id; 1426 // If the direct parent is not an activity update, that means we've reached 1427 // the parent activity item (eg. new_blog_post) 1428 if ( 'activity_update' !== $direct_parent->type ) { 1429 $parent_id = $r->item_id; 1430 1431 } else { 1432 $parent_id = $direct_parent->secondary_item_id; 1433 } 1434 1428 1435 } else { 1429 // Something went wrong 1430 // Short-circuit the 1431 // depth calculation 1436 // Something went wrong. Short-circuit the depth calculation 1432 1437 $parent_id = $r->item_id; 1433 1438 }
Note: See TracChangeset
for help on using the changeset viewer.