Skip to:
Content

BuddyPress.org

Changeset 2666 for trunk/bp-activity.php


Ignore:
Timestamp:
02/11/2010 12:50:00 PM (14 years ago)
Author:
apeatling
Message:

Make sure activity comments are separating their action an content and also being hidden publicly if on a private activity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2656 r2666  
    627627        $parent_id = $activity_id;
    628628
    629     /* Insert the "user posted a new activity comment header text" */
    630     $comment_header = '<div class="comment-header">' . sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) . ' <span class="time-since">%s</span></div> ';
     629    /* Check to see if the parent activity is hidden, and if so, hide this comment publically. */
     630    $activity = new BP_Activity_Activity( $activity_id );
     631    $is_hidden = ( (int)$activity->hide_sitewide ) ? 1 : 0;
    631632
    632633    /* Insert the activity comment */
    633634    $comment_id = bp_activity_add( array(
    634         'content' => apply_filters( 'bp_activity_comment_content', $comment_header . '<div class="activity-inner">' . $content . '</div>' ),
    635         'primary_link' => '',
     635        'action' => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
     636        'content' => apply_filters( 'bp_activity_comment_content', '<div class="activity-inner">' . $content . '</div>' ),
    636637        'component' => $bp->activity->id,
    637638        'type' => 'activity_comment',
    638639        'user_id' => $user_id,
    639640        'item_id' => $activity_id,
    640         'secondary_item_id' => $parent_id
     641        'secondary_item_id' => $parent_id,
     642        'hide_sitewide' => $is_hidden
    641643    ) );
    642644
Note: See TracChangeset for help on using the changeset viewer.