Changeset 14150 for branches/14.0/src/bp-activity/bp-activity-template.php
- Timestamp:
- 12/16/2025 04:29:43 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/14.0/src/bp-activity/bp-activity-template.php
r13897 r14150 2635 2635 $comments = BP_Activity_Activity::get_activity_comments( $comment->item_id, 1, constant( 'PHP_INT_MAX' ) ); 2636 2636 2637 if ( ! is_array( $comments ) ) { 2638 $comments = []; 2639 } 2640 2637 2641 // Recursively find our comment object from the comment tree. 2638 $iterator = new RecursiveArrayIterator( $comments ); 2639 $recursive = new RecursiveIteratorIterator( $iterator, RecursiveIteratorIterator::SELF_FIRST ); 2640 foreach ( $recursive as $cid => $cobj ) { 2641 // Skip items that are not a comment object. 2642 if ( ! is_numeric( $cid ) || ! is_object( $cobj ) ) { 2643 continue; 2644 } 2645 2646 // We found the activity comment! Set the depth. 2647 if ( $cid === $comment->id && isset( $cobj->depth ) ) { 2648 $depth = $cobj->depth; 2649 break; 2650 } 2642 $comment_in_tree = BP_Activity_Activity::find_comment_in_tree( $comments, $comment->id ); 2643 2644 if ( is_object( $comment_in_tree ) && isset( $comment_in_tree->depth ) ) { 2645 $depth = $comment_in_tree->depth; 2651 2646 } 2652 2647 }
Note: See TracChangeset
for help on using the changeset viewer.