Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2015 02:07:44 AM (8 years ago)
Author:
tw2113
Message:

More docs cleanup for Friends component.

See #6400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-activity.php

    r10147 r10323  
    9191    $bp = buddypress();
    9292
    93     // These two added in BP 1.6
     93    // These two added in BP 1.6.
    9494    bp_activity_set_action(
    9595        $bp->friends->id,
     
    110110    );
    111111
    112     // < BP 1.6 backpat
     112    // < BP 1.6 backpat.
    113113    bp_activity_set_action( $bp->friends->id, 'friends_register_activity_action', __( 'New friendship created', 'buddypress' ) );
    114114
     
    129129 * @param string $action   Activity action string.
    130130 * @param object $activity Activity data.
    131  *
    132131 * @return string $action Formatted activity action.
    133132 */
     
    140139    // Backward compatibility for legacy filter
    141140    // The old filter has the $friendship object passed to it. We want to
    142     // avoid having to build this object if it's not necessary
     141    // avoid having to build this object if it's not necessary.
    143142    if ( has_filter( 'friends_activity_friendship_accepted_action' ) ) {
    144143        $friendship = new BP_Friends_Friendship( $activity->item_id );
     
    164163 * @param string $action   Static activity action.
    165164 * @param object $activity Activity data.
    166  *
    167165 * @return string $action Formatted activity action.
    168166 */
     
    175173    // Backward compatibility for legacy filter
    176174    // The old filter has the $friendship object passed to it. We want to
    177     // avoid having to build this object if it's not necessary
     175    // avoid having to build this object if it's not necessary.
    178176    if ( has_filter( 'friends_activity_friendship_accepted_action' ) ) {
    179177        $friendship = new BP_Friends_Friendship( $activity->item_id );
     
    200198 *
    201199 * @param array $activities Array of activity items.
    202  *
    203200 * @return array
    204201 */
     
    219216
    220217    if ( ! empty( $friend_ids ) ) {
    221         // Fire a user query to prime user caches
     218        // Fire a user query to prime user caches.
    222219        new BP_User_Query( array(
    223220            'user_ids'          => $friend_ids,
     
    238235 * @since 2.2.0
    239236 *
    240  * @param array $retval Empty array by default
    241  * @param array $filter Current activity arguments
    242  *
     237 * @param array $retval Empty array by default.
     238 * @param array $filter Current activity arguments.
    243239 * @return array
    244240 */
    245241function bp_friends_filter_activity_scope( $retval = array(), $filter = array() ) {
    246242
    247     // Determine the user_id
     243    // Determine the user_id.
    248244    if ( ! empty( $filter['user_id'] ) ) {
    249245        $user_id = $filter['user_id'];
     
    254250    }
    255251
    256     // Determine friends of user
     252    // Determine friends of user.
    257253    $friends = friends_get_friend_user_ids( $user_id );
    258254    if ( empty( $friends ) ) {
     
    268264        ),
    269265
    270         // we should only be able to view sitewide activity content for friends
     266        // We should only be able to view sitewide activity content for friends.
    271267        array(
    272268            'column' => 'hide_sitewide',
     
    274270        ),
    275271
    276         // overrides
     272        // Overrides.
    277273        'override' => array(
    278274            'filter'      => array( 'user_id' => 0 ),
     
    292288 * @since 2.2.0
    293289 *
    294  * @param array $retval Empty array by default
    295  * @param array $filter Current activity arguments
     290 * @param array $retval Empty array by default.
     291 * @param array $filter Current activity arguments.
    296292 *
    297293 * @return array
     
    299295function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = array() ) {
    300296
    301     // Determine the user_id
     297    // Determine the user_id.
    302298    if ( ! empty( $filter['user_id'] ) ) {
    303299        $user_id = $filter['user_id'];
     
    308304    }
    309305
    310     // Get the requested action
     306    // Get the requested action.
    311307    $action = $filter['filter']['action'];
    312308
    313     // Make sure actions are listed in an array
     309    // Make sure actions are listed in an array.
    314310    if ( ! is_array( $action ) ) {
    315311        $action = explode( ',', $filter['filter']['action'] );
     
    326322    }
    327323
    328     // Juggle existing override value
     324    // Juggle existing override value.
    329325    $override = array();
    330326    if ( ! empty( $retval['override'] ) ) {
     
    354350    );
    355351
    356     // Juggle back override value
     352    // Juggle back override value.
    357353    if ( ! empty( $override ) ) {
    358354        $retval['override'] = $override;
     
    369365 * @since 1.9.0
    370366 *
    371  * @param int         $friendship_id
    372  * @param int         $initiator_user_id
    373  * @param int         $friend_user_id
    374  * @param object|bool $friendship Optional
     367 * @param int         $friendship_id       ID of the friendship.
     368 * @param int         $initiator_user_id   ID of friendship initiator.
     369 * @param int         $friend_user_id      ID of user whose friendship is requested.
     370 * @param object|bool $friendship Optional Friendship object.
    375371 */
    376372function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) {
     
    379375    }
    380376
    381     // Record in activity streams for the initiator
     377    // Record in activity streams for the initiator.
    382378    friends_record_activity( array(
    383379        'user_id'           => $initiator_user_id,
Note: See TracChangeset for help on using the changeset viewer.