diff --git src/bp-activity/classes/class-bp-activity-activity.php src/bp-activity/classes/class-bp-activity-activity.php
index a4e82ba..7fad5ee 100644
|
|
class BP_Activity_Activity { |
537 | 537 | 'activities' => null, |
538 | 538 | 'total' => null, |
539 | 539 | 'has_more_items' => null, |
| 540 | 'stream_mode' => $r['display_comments'], |
540 | 541 | ); |
541 | 542 | |
542 | 543 | /** |
diff --git src/bp-activity/classes/class-bp-activity-template.php src/bp-activity/classes/class-bp-activity-template.php
index 864e551..740bcd7 100644
|
|
class BP_Activity_Template { |
248 | 248 | |
249 | 249 | $this->has_more_items = $this->activities['has_more_items']; |
250 | 250 | |
| 251 | // Add the stream mode to inform how activity comments are displayed |
| 252 | $this->stream_mode = $this->activities['stream_mode']; |
| 253 | |
251 | 254 | $this->activities = $this->activities['activities']; |
252 | 255 | |
253 | 256 | if ( $max ) { |
diff --git src/bp-members/bp-members-filters.php src/bp-members/bp-members-filters.php
index 5575ebe..14d4e4a 100644
|
|
function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) { |
127 | 127 | return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme ); |
128 | 128 | } |
129 | 129 | add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 ); |
| 130 | |
| 131 | |
| 132 | /** |
| 133 | * Makes sure to avoid duplicate comments on the Just Me scope. |
| 134 | * |
| 135 | * @since 2.6.0 |
| 136 | * |
| 137 | * @param bool $can_comment True if the user can comment the activity. False otherwise. |
| 138 | * @return bool Unchanged if Activity stream mode is not 'stream'. False otherwise. |
| 139 | */ |
| 140 | function bp_members_comments_avoid_duplicates( $can_comment ) { |
| 141 | global $activities_template; |
| 142 | |
| 143 | if ( 'stream' === $activities_template->stream_mode && bp_is_current_action( 'just-me' ) ) { |
| 144 | if ( ! empty( $activities_template->activity->children ) ) { |
| 145 | $activities_template->activity->children = array(); |
| 146 | } |
| 147 | |
| 148 | $can_comment = false; |
| 149 | } |
| 150 | |
| 151 | return $can_comment; |
| 152 | } |
| 153 | add_filter( 'bp_activity_can_comment', 'bp_members_comments_avoid_duplicates' ); |