Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2016 05:35:55 AM (3 years ago)
Author:
boonebgorges
Message:

Use new groups_get_group() syntax throughout BP.

See #5451.

File:
1 edited

Legend:

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

    r11090 r11091  
    4343 * @return BP_Groups_Group $group The group object.
    4444 */
    45 function groups_get_group( $args = '' ) {
     45function groups_get_group( $group_id ) {
    4646    // Backward compatibilty.
    47     if ( is_array( $args ) && isset( $args['group_id'] ) ) {
    48         $group_id = $args['group_id'];
     47    if ( is_array( $group_id ) && isset( $group_id['group_id'] ) ) {
     48        $group_id = $group_id['group_id'];
    4949    }
    5050
     
    105105    // Pass an existing group ID.
    106106    if ( ! empty( $group_id ) ) {
    107         $group = groups_get_group( array( 'group_id' => $group_id ) );
     107        $group = groups_get_group( $group_id );
    108108        $name  = ! empty( $name ) ? $name : $group->name;
    109109        $slug  = ! empty( $slug ) ? $slug : $group->slug;
     
    219219        return false;
    220220
    221     $group     = groups_get_group( array( 'group_id' => $group_id ) );
     221    $group     = groups_get_group( $group_id );
    222222    $old_group = clone $group;
    223223
     
    263263function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status = false ) {
    264264
    265     $group = groups_get_group( array( 'group_id' => $group_id ) );
     265    $group = groups_get_group( $group_id );
    266266    $group->enable_forum = $enable_forum;
    267267
     
    324324
    325325    // Get the group object.
    326     $group = groups_get_group( array( 'group_id' => $group_id ) );
     326    $group = groups_get_group( $group_id );
    327327
    328328    // Bail if group cannot be deleted.
     
    396396 */
    397397function groups_get_slug( $group_id ) {
    398     $group = groups_get_group( array( 'group_id' => $group_id ) );
     398    $group = groups_get_group( $group_id );
    399399    return !empty( $group->slug ) ? $group->slug : '';
    400400}
     
    498498
    499499    if ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group || $group_id != $bp->groups->current_group->id )
    500         $group = groups_get_group( array( 'group_id' => $group_id ) );
     500        $group = groups_get_group( $group_id );
    501501    else
    502502        $group = $bp->groups->current_group;
     
    11951195        return false;
    11961196
    1197     $bp->groups->current_group = groups_get_group( array( 'group_id' => $group_id ) );
     1197    $bp->groups->current_group = groups_get_group( $group_id );
    11981198
    11991199    // Be sure the user is a member of the group before posting.
     
    15031503    // Send friend invites.
    15041504    $invited_users = groups_get_invites_for_group( $user_id, $group_id );
    1505     $group = groups_get_group( array( 'group_id' => $group_id ) );
     1505    $group = groups_get_group( $group_id );
    15061506
    15071507    for ( $i = 0, $count = count( $invited_users ); $i < $count; ++$i ) {
Note: See TracChangeset for help on using the changeset viewer.