Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/22/2015 04:58:34 AM (5 years ago)
Author:
tw2113
Message:

More docs cleanup for BP-Groups component.

See #6401.

File:
1 edited

Legend:

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

    r10148 r10373  
    5454    // These actions are for the legacy forums
    5555    // Since the bbPress plugin also shares the same 'forums' identifier, we also
    56     // check for the legacy forums loader class to be extra cautious
     56    // check for the legacy forums loader class to be extra cautious.
    5757    if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
    5858        bp_activity_set_action(
     
    9191 * @param string $action   Static activity action.
    9292 * @param object $activity Activity data object.
    93  *
    9493 * @return string
    9594 */
     
    123122 * @param string $action   Static activity action.
    124123 * @param object $activity Activity data object.
    125  *
    126124 * @return string
    127125 */
     
    138136
    139137    // Legacy filters (do not follow parameter patterns of other activity
    140     // action filters, and requires apply_filters_ref_array())
     138    // action filters, and requires apply_filters_ref_array()).
    141139    if ( has_filter( 'groups_activity_membership_accepted_action' ) ) {
    142140        $action = apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( $action, $user_link, &$group ) );
    143141    }
    144142
    145     // Another legacy filter
     143    // Another legacy filter.
    146144    if ( has_filter( 'groups_activity_accepted_invite_action' ) ) {
    147145        $action = apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( $action, $activity->user_id, &$group ) );
     
    166164 * @param  string $action   Static activity action.
    167165 * @param  object $activity Activity data object.
    168  *
    169166 * @return string
    170167 */
     
    221218 *
    222219 * @param array $activities Array of activity items.
    223  *
    224220 * @return array
    225221 */
     
    243239        // TEMPORARY - Once the 'populate_extras' issue is solved
    244240        // in the groups component, we can do this with groups_get_groups()
    245         // rather than manually
     241        // rather than manually.
    246242        $uncached_ids = array();
    247243        foreach ( $group_ids as $group_id ) {
     
    271267 * @since 2.2.0
    272268 *
    273  * @param array $retval Empty array by default
    274  * @param array $filter Current activity arguments
     269 * @param array $retval Empty array by default.
     270 * @param array $filter Current activity arguments.
    275271 *
    276272 * @return array
     
    278274function bp_groups_filter_activity_scope( $retval = array(), $filter = array() ) {
    279275
    280     // Determine the user_id
     276    // Determine the user_id.
    281277    if ( ! empty( $filter['user_id'] ) ) {
    282278        $user_id = $filter['user_id'];
     
    287283    }
    288284
    289     // Determine groups of user
     285    // Determine groups of user.
    290286    $groups = groups_get_user_groups( $user_id );
    291287    if ( empty( $groups['groups'] ) ) {
     
    318314        $show_hidden,
    319315
    320         // overrides
     316        // Overrides.
    321317        'override' => array(
    322318            'filter'      => array( 'user_id' => 0 ),
     
    355351    }
    356352
    357     // Set the default for hide_sitewide by checking the status of the group
     353    // Set the default for hide_sitewide by checking the status of the group.
    358354    $hide_sitewide = false;
    359355    if ( !empty( $args['item_id'] ) ) {
     
    391387 * @param int $group_id Optional. The ID of the group whose last_activity is
    392388 *                      being updated. Default: the current group's ID.
    393  *
    394389 * @return bool|null False on failure.
    395390 */
     
    419414 * @param int $user_id  ID of the user joining the group.
    420415 * @param int $group_id ID of the group.
    421  *
    422416 * @return bool|null False on failure.
    423417 */
    424418function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) {
    425419
    426     // Bail if Activity is not active
     420    // Bail if Activity is not active.
    427421    if ( ! bp_is_active( 'activity' ) ) {
    428422        return false;
    429423    }
    430424
    431     // Get the group so we can get it's name
     425    // Get the group so we can get it's name.
    432426    $group = groups_get_group( array( 'group_id' => $group_id ) );
    433427
     
    443437    $action = apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), $user_id, &$group ) );
    444438
    445     // Record in activity streams
     439    // Record in activity streams.
    446440    groups_record_activity( array(
    447441        'action'  => $action,
     
    461455 * @param  BP_Groups_Group $old_group      Group object before the details had been changed.
    462456 * @param  bool            $notify_members True if the admin has opted to notify group members, otherwise false.
    463  *
    464457 * @return int|bool The ID of the activity on success. False on error.
    465458 */
     
    475468    }
    476469
    477     // If the admin has opted not to notify members, don't post an activity item either
     470    // If the admin has opted not to notify members, don't post an activity item either.
    478471    if ( empty( $notify_members ) ) {
    479472        return;
     
    557550function bp_groups_leave_group_delete_recent_activity( $group_id, $user_id ) {
    558551
    559     // Bail if Activity component is not active
     552    // Bail if Activity component is not active.
    560553    if ( ! bp_is_active( 'activity' ) ) {
    561554        return;
    562555    }
    563556
    564     // Get the member's group membership information
     557    // Get the member's group membership information.
    565558    $membership = new BP_Groups_Member( $user_id, $group_id );
    566559
    567     // Check the time period, and maybe delete their recent group activity
     560    // Check the time period, and maybe delete their recent group activity.
    568561    if ( time() <= strtotime( '+5 minutes', (int) strtotime( $membership->date_modified ) ) ) {
    569562        bp_activity_delete( array(
Note: See TracChangeset for help on using the changeset viewer.