Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/29/2014 12:40:28 AM (12 years ago)
Author:
boonebgorges
Message:

Use WP's comment depth setting to limit activity comment depth

Fixes #2768

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/buddypress-functions.php

    r8150 r8201  
    773773                $activities_template->activity->id              = $activities_template->activities[0]->item_id;
    774774                $activities_template->activity->current_comment = $activities_template->activities[0];
     775
     776                // Because the whole tree has not been loaded, we manually
     777                // determine depth
     778                $depth = 1;
     779                $parent_id = $activities_template->activities[0]->secondary_item_id;
     780                while ( $parent_id !== $activities_template->activities[0]->item_id ) {
     781                        $depth++;
     782                        $p_obj = new BP_Activity_Activity( $parent_id );
     783                        $parent_id = $p_obj->secondary_item_id;
     784                }
     785                $activities_template->activity->current_comment->depth = $depth;
    775786        }
    776787
Note: See TracChangeset for help on using the changeset viewer.