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-activity/bp-activity-template.php

    r8190 r8201  
    17981798         * @since BuddyPress (1.2)
    17991799         *
    1800          * @todo remove $counter global
    1801          *
    18021800         * @param object $comment The activity object currently being recursed
    18031801         *
     
    21522150
    21532151/**
     2152 * Output the depth of the current activity comment.
     2153 *
     2154 * @since BuddyPress (2.0.0)
     2155 */
     2156function bp_activity_comment_depth() {
     2157    echo bp_activity_get_comment_depth();
     2158}
     2159    /**
     2160     * Return the current activity comment depth.
     2161     *
     2162     * @since BuddyPress (2.0.0)
     2163     *
     2164     * @return int
     2165     */
     2166    function bp_activity_get_comment_depth() {
     2167        global $activities_template;
     2168        return apply_filters( 'bp_activity_get_comment_depth', $activities_template->activity->current_comment->depth );
     2169    }
     2170
     2171/**
    21542172 * Output the activity comment link.
    21552173 *
     
    26522670    $can_comment = true;
    26532671
     2672    if ( get_option( 'thread_comments' ) && bp_activity_get_comment_depth() >= get_option( 'thread_comments_depth' ) ) {
     2673        $can_comment = false;
     2674    }
     2675
    26542676    return apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment );
    26552677}
Note: See TracChangeset for help on using the changeset viewer.