Skip to:
Content

BuddyPress.org

Changeset 5689


Ignore:
Timestamp:
02/10/2012 01:17:51 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Remove unneeded globals and clean up some code in Groups component. See #3989.

Location:
trunk/bp-groups
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-actions.php

    r5620 r5689  
    11<?php
    2 /********************************************************************************
    3  * Action Functions
     2
     3/**
     4 * BuddyPress Groups Activity & Notification Functions
    45 *
    56 * Action functions are exactly the same as screen functions, however they do not
    67 * have a template screen associated with them. Usually they will send the user
    78 * back to the default screen after execution.
     9 *
     10 * @package BuddyPress
     11 * @subpackage GroupsActions
    812 */
    913
     
    288292
    289293function groups_action_redirect_to_random_group() {
    290         global $bp, $wpdb;
    291294
    292295        if ( bp_is_groups_component() && isset( $_GET['random-group'] ) ) {
     
    316319}
    317320add_action( 'bp_actions', 'groups_action_group_feed' );
     321
    318322?>
  • trunk/bp-groups/bp-groups-activity.php

    r5431 r5689  
    11<?php
     2
    23/**
    34 * BuddyPress Groups Activity & Notification Functions
     
    6364        global $bp;
    6465
    65         if ( !$group_id )
     66        if ( empty( $group_id ) )
    6667                $group_id = $bp->groups->current_group->id;
    6768
    68         if ( !$group_id )
     69        if ( empty( $group_id ) )
    6970                return false;
    7071
    7172        groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
    7273}
    73 add_action( 'groups_leave_group', 'groups_update_last_activity' );
    74 add_action( 'groups_created_group', 'groups_update_last_activity' );
    75 add_action( 'groups_new_forum_topic', 'groups_update_last_activity' );
     74add_action( 'groups_leave_group',          'groups_update_last_activity' );
     75add_action( 'groups_created_group',        'groups_update_last_activity' );
     76add_action( 'groups_new_forum_topic',      'groups_update_last_activity' );
    7677add_action( 'groups_new_forum_topic_post', 'groups_update_last_activity' );
    7778
    7879function groups_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    79         global $bp;
    8080
    8181        switch ( $action ) {
     
    305305        return false;
    306306}
     307
    307308?>
  • trunk/bp-groups/bp-groups-adminbar.php

    r5519 r5689  
    11<?php
     2
    23/**
    34 * BuddyPress Groups Admin Bar
  • trunk/bp-groups/bp-groups-buddybar.php

    r5687 r5689  
    11<?php
     2
     3/**
     4 * BuddyPress Groups BuddyBar
     5 *
     6 * @package BuddyPress
     7 * @subpackage GroupsBuddyBar
     8 */
     9
    210// Exit if accessed directly
    311if ( !defined( 'ABSPATH' ) ) exit;
    412
     13/**
     14 * Adds menu items to the BuddyBar
     15 *
     16 * @since BuddyPress (1.0)
     17 * @global BuddyPress $bp
     18 * @return False if no menu
     19 */
    520function bp_groups_adminbar_admin_menu() {
    621        global $bp;
  • trunk/bp-groups/bp-groups-cache.php

    r5460 r5689  
    11<?php
     2
    23/**
    34 * BuddyPress Groups Caching
  • trunk/bp-groups/bp-groups-classes.php

    r5687 r5689  
    5959                        $admin_mods = $wpdb->get_results( apply_filters( 'bp_group_admin_mods_user_join_filter', $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )", $this->id ) ) );
    6060                        foreach( (array)$admin_mods as $user ) {
    61                                 if ( (int)$user->is_admin )
     61                                if ( (int) $user->is_admin )
    6262                                        $this->admins[] = $user;
    6363                                else
     
    191191                global $wpdb, $bp;
    192192
    193                 if ( !$user_id )
     193                if ( empty( $user_id ) )
    194194                        $user_id = bp_displayed_user_id();
    195195
     
    796796
    797797        function ban() {
    798                 global $bp;
    799798
    800799                if ( $this->is_admin )
     
    808807                $group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true );
    809808                if ( !empty( $group_count ) )
    810                         bp_update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
     809                        bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 );
    811810
    812811                return $this->save();
     
    814813
    815814        function unban() {
    816                 global $bp;
    817815
    818816                if ( $this->is_admin )
     
    822820
    823821                groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) );
    824                 bp_update_user_meta( $this->user_id, 'total_group_count', (int)bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
     822                bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
    825823
    826824                return $this->save();
     
    828826
    829827        function accept_invite() {
    830                 global $bp;
    831828
    832829                $this->inviter_id    = 0;
     
    834831                $this->date_modified = bp_core_current_time();
    835832
    836                 bp_update_user_meta( $this->user_id, 'total_group_count', (int)bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
     833                bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
    837834        }
    838835
    839836        function accept_request() {
    840                 global $bp;
    841837
    842838                $this->is_confirmed = 1;
    843839                $this->date_modified = bp_core_current_time();
    844840
    845                 bp_update_user_meta( $this->user_id, 'total_group_count', (int)bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
     841                bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
    846842        }
    847843
     
    858854                $group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true );
    859855                if ( !empty( $group_count ) )
    860                         bp_update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
     856                        bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 );
    861857
    862858                return $result;
     
    961957                global $bp, $wpdb;
    962958
    963                 if ( !$user_id )
     959                if ( empty( $user_id ) )
    964960                        $user_id = bp_displayed_user_id();
    965961
     
    987983                global $wpdb, $bp;
    988984
    989                 if ( !$user_id )
     985                if ( empty( $user_id ) )
    990986                        return false;
    991987
     
    1001997                global $wpdb, $bp;
    1002998
    1003                 if ( !$user_id )
     999                if ( empty( $user_id ) )
    10041000                        return false;
    10051001
     
    10101006                global $wpdb, $bp;
    10111007
    1012                 if ( !$user_id )
     1008                if ( empty( $user_id ) )
    10131009                        return false;
    10141010
     
    10191015                global $wpdb, $bp;
    10201016
    1021                 if ( !$user_id )
     1017                if ( empty( $user_id ) )
    10221018                        return false;
    10231019
     
    10281024                global $wpdb, $bp;
    10291025
    1030                 if ( !$user_id )
     1026                if ( empty( $user_id ) )
    10311027                        return false;
    10321028
     
    10371033                global $wpdb, $bp;
    10381034
    1039                 if ( !$user_id )
     1035                if ( empty( $user_id ) )
    10401036                        return false;
    10411037
     
    10461042                global $wpdb, $bp;
    10471043
    1048                 if ( !$user_id )
     1044                if ( empty( $user_id ) )
    10491045                        return false;
    10501046
     
    10641060                global $bp, $wpdb;
    10651061
    1066                 if ( !$user_id )
     1062                if ( empty( $user_id ) )
    10671063                        return false;
    10681064
     
    10731069                global $wpdb, $bp;
    10741070
    1075                 if ( !$user_id )
     1071                if ( empty( $user_id ) )
    10761072                        return false;
    10771073
     
    13361332                return false;
    13371333
    1338         /* Register the group extension on the bp_init action so we have access to all plugins */
     1334        // Register the group extension on the bp_init action so we have access
     1335        // to all plugins.
    13391336        add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_actions", array( &$extension, "_register" ), 8 );' ), 11 );
    13401337}
  • trunk/bp-groups/bp-groups-filters.php

    r5560 r5689  
    5757        $groups_allowedtags['img']['id']     = array();
    5858        $groups_allowedtags['code']          = array();
     59        $groups_allowedtags = apply_filters( 'bp_groups_filter_kses', $groups_allowedtags );
    5960
    60         $groups_allowedtags = apply_filters( 'bp_groups_filter_kses', $groups_allowedtags );
    6161        return wp_kses( $content, $groups_allowedtags );
    6262}
    6363
    64 /**** Filters for group forums ****/
     64/** Group forums **************************************************************/
    6565
     66/**
     67 * Only filter the forum SQL on group pages or on the forums directory
     68 */
    6669function groups_add_forum_privacy_sql() {
    67         global $bp;
    68 
    69         // Only filter the forum SQL on group pages or on the forums directory
    70         add_filter( 'get_topics_fields',     'groups_add_forum_fields_sql' );
    71         add_filter( 'get_topics_join',       'groups_add_forum_tables_sql' );
    72         add_filter( 'get_topics_where',      'groups_add_forum_where_sql'  );
     70        add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
     71        add_filter( 'get_topics_join',   'groups_add_forum_tables_sql' );
     72        add_filter( 'get_topics_where',  'groups_add_forum_where_sql'  );
    7373}
    7474add_filter( 'bbpress_init', 'groups_add_forum_privacy_sql' );
    7575
    7676function groups_add_forum_fields_sql( $sql = '' ) {
    77         return 't.*, g.id as object_id, g.name as object_name, g.slug as object_slug';
     77        $sql = 't.*, g.id as object_id, g.name as object_name, g.slug as object_slug';
     78        return $sql;
    7879}
    7980
     
    8889function groups_add_forum_where_sql( $sql = '' ) {
    8990        global $bp;
     91
     92        // Define locale variable
     93        $parts = array();
    9094
    9195        // Set this for groups
     
    153157}
    154158add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
     159
    155160?>
  • trunk/bp-groups/bp-groups-forums.php

    r5642 r5689  
    11<?php
    2 /*** Group Forums **************************************************************/
     2
     3/**
     4 * BuddyPress Groups Forums
     5 *
     6 * Action functions are exactly the same as screen functions, however they do not
     7 * have a template screen associated with them. Usually they will send the user
     8 * back to the default screen after execution.
     9 *
     10 * @package BuddyPress
     11 * @subpackage GroupsForums
     12 */
    313
    414// Exit if accessed directly
  • trunk/bp-groups/bp-groups-functions.php

    r5687 r5689  
    5656
    5757function groups_create_group( $args = '' ) {
    58         global $bp;
    5958
    6059        extract( $args );
     
    7271         */
    7372
    74         if ( isset( $group_id ) && $group_id )
     73        if ( !empty( $group_id ) )
    7574                $group = groups_get_group( array( 'group_id' => $group_id ) );
    7675        else
    7776                $group = new BP_Groups_Group;
    7877
    79         if ( isset( $creator_id ) && $creator_id )
     78        if ( !empty( $creator_id ) )
    8079                $group->creator_id = $creator_id;
    8180        else
     
    9291
    9392        if ( isset( $status ) ) {
    94                 if ( groups_is_valid_status( $status ) )
     93                if ( groups_is_valid_status( $status ) ) {
    9594                        $group->status = $status;
     95                }
    9696        }
    9797
    9898        if ( isset( $enable_forum ) )
    9999                $group->enable_forum = $enable_forum;
    100         else if ( !$group_id && !isset( $enable_forum ) )
     100        else if ( empty( $group_id ) && !isset( $enable_forum ) )
    101101                $group->enable_forum = 1;
    102102
     
    116116                $member->is_confirmed  = 1;
    117117                $member->date_modified = bp_core_current_time();
    118 
    119118                $member->save();
     119
    120120                do_action( 'groups_create_group', $group->id, $member, $group );
    121121
     
    130130
    131131function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $notify_members ) {
    132         global $bp;
    133132
    134133        if ( empty( $group_name ) || empty( $group_desc ) )
     
    152151
    153152function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status = false ) {
    154         global $bp;
    155153
    156154        $group = groups_get_group( array( 'group_id' => $group_id ) );
     
    264262        global $bp;
    265263
    266         if ( !$user_id )
     264        if ( empty( $user_id ) )
    267265                $user_id = bp_loggedin_user_id();
    268266
     
    305303        global $bp;
    306304
    307         if ( !$user_id )
     305        if ( empty( $user_id ) )
    308306                $user_id = bp_loggedin_user_id();
    309307
     
    379377
    380378function groups_get_groups( $args = '' ) {
    381         global $bp;
    382379
    383380        $defaults = array(
     
    388385                'search_terms'    => false,    // Limit to groups that match these search terms
    389386                'show_hidden'     => false,    // Show hidden groups to non-admins
    390 
    391387                'per_page'        => 20,       // The number of results to return per page
    392388                'page'            => 1,        // The page to return if limiting per page
     
    412408
    413409function groups_get_user_groups( $user_id = 0, $pag_num = 0, $pag_page = 0 ) {
    414         global $bp;
    415 
    416         if ( !$user_id )
     410
     411        if ( empty( $user_id ) )
    417412                $user_id = bp_displayed_user_id();
    418413
     
    421416
    422417function groups_total_groups_for_user( $user_id = 0 ) {
    423         global $bp;
    424 
    425         if ( !$user_id )
     418
     419        if ( empty( $user_id ) )
    426420                $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
    427421
     
    548542
    549543function groups_get_invites_for_user( $user_id = 0, $limit = false, $page = false, $exclude = false ) {
    550         global $bp;
    551 
    552         if ( !$user_id )
     544
     545        if ( empty( $user_id ) )
    553546                $user_id = bp_loggedin_user_id();
    554547
     
    557550
    558551function groups_invite_user( $args = '' ) {
    559         global $bp;
    560552
    561553        $defaults = array(
     
    570562        extract( $args, EXTR_SKIP );
    571563
    572         if ( !$user_id || !$group_id )
     564        if ( empty( $user_id ) || empty( $group_id ) )
    573565                return false;
    574566
     
    591583
    592584function groups_uninvite_user( $user_id, $group_id ) {
    593         global $bp;
    594585
    595586        if ( !BP_Groups_Member::delete( $user_id, $group_id ) )
     
    648639
    649640function groups_send_invites( $user_id, $group_id ) {
    650         global $bp;
    651 
    652         if ( !$user_id )
     641
     642        if ( empty( $user_id ) )
    653643                $user_id = bp_loggedin_user_id();
    654644
     
    711701
    712702function groups_demote_member( $user_id, $group_id ) {
    713         global $bp;
     703
     704        if ( ! bp_is_item_admin() || ! bp_is_item_mod() )
     705                return false;
    714706
    715707        $member = new BP_Groups_Member( $user_id, $group_id );
     
    761753
    762754function groups_send_membership_request( $requesting_user_id, $group_id ) {
    763         global $bp;
    764755
    765756        // Prevent duplicate requests
     
    797788
    798789function groups_accept_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
    799         global $bp;
    800 
    801         if ( $user_id && $group_id )
     790
     791        if ( !empty( $user_id ) && !empty( $group_id ) )
    802792                $membership = new BP_Groups_Member( $user_id, $group_id );
    803793        else
     
    847837
    848838function groups_delete_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
    849         if ( $user_id && $group_id )
     839        if ( !empty( $user_id ) && !empty( $group_id ) )
    850840                $membership = new BP_Groups_Member( $user_id, $group_id );
    851841        else
  • trunk/bp-groups/bp-groups-notifications.php

    r5431 r5689  
    44
    55function groups_notification_group_updated( $group_id ) {
    6         global $bp;
    76
    87        $group    = groups_get_group( array( 'group_id' => $group_id ) );
     
    4746
    4847function groups_notification_new_membership_request( $requesting_user_id, $admin_id, $group_id, $membership_id ) {
    49         global $bp;
    5048
    5149        bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
     
    5553
    5654        $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
    57         $group = groups_get_group( array( 'group_id' => $group_id ) );
    58 
    59         $ud = bp_core_get_core_userdata($admin_id);
    60         $requesting_ud = bp_core_get_core_userdata($requesting_user_id);
    61 
     55        $group                = groups_get_group( array( 'group_id' => $group_id ) );
     56
     57        $ud             = bp_core_get_core_userdata( $admin_id );
     58        $requesting_ud  = bp_core_get_core_userdata( $requesting_user_id );
    6259        $group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests';
    6360        $profile_link   = bp_core_get_user_domain( $requesting_user_id );
     
    9693
    9794function groups_notification_membership_request_completed( $requesting_user_id, $group_id, $accepted = true ) {
    98         global $bp;
    9995
    10096        // Post a screen notification first.
     
    153149
    154150function groups_notification_promoted_member( $user_id, $group_id ) {
    155         global $bp;
    156151
    157152        if ( groups_is_user_admin( $user_id, $group_id ) ) {
     
    202197
    203198function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
    204         global $bp;
    205 
    206         $inviter_ud = bp_core_get_core_userdata( $inviter_user_id );
     199
     200        // @todo $inviter_up may be used for caching, test without it
     201        $inviter_ud   = bp_core_get_core_userdata( $inviter_user_id );
    207202        $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true );
    208203        $inviter_link = bp_core_get_user_domain( $inviter_user_id );
     
    219214                        return false;
    220215
    221                 $invited_ud = bp_core_get_core_userdata($invited_user_id);
    222 
     216                $invited_ud    = bp_core_get_core_userdata($invited_user_id);
    223217                $settings_link = bp_core_get_user_domain( $invited_user_id ) . bp_get_settings_slug() . '/notifications/';
    224                 $invited_link = bp_core_get_user_domain( $invited_user_id );
    225                 $invites_link = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
     218                $invited_link  = bp_core_get_user_domain( $invited_user_id );
     219                $invites_link  = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
    226220
    227221                // Set up and send the message
  • trunk/bp-groups/bp-groups-screens.php

    r5687 r5689  
    820820 */
    821821function groups_screen_notification_settings() {
    822         global $bp;
    823822
    824823        if ( !$group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) )
     
    879878}
    880879add_action( 'bp_notification_settings', 'groups_screen_notification_settings' );
     880
    881881?>
  • trunk/bp-groups/bp-groups-template.php

    r5687 r5689  
    105105
    106106        function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ){
    107 
    108                 global $bp;
    109107
    110108                $this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page;
     
    163161
    164162                // Build pagination links
    165                 if ( (int)$this->total_group_count && (int)$this->pag_num ) {
     163                if ( (int) $this->total_group_count && (int)$this->pag_num ) {
    166164                        $this->pag_links = paginate_links( array(
    167165                                'base'      => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
     
    211209
    212210        function the_group() {
    213                 global $group;
    214 
    215211                $this->in_the_loop = true;
    216                 $this->group = $this->next_group();
     212                $this->group       = $this->next_group();
    217213
    218214                if ( $this->single_group )
     
    298294
    299295function bp_group_is_visible( $group = false ) {
    300         global $bp, $groups_template;
     296        global $groups_template;
    301297
    302298        if ( bp_current_user_can( 'bp_moderate' ) )
     
    382378
    383379                $defaults = array(
    384                         'type' => 'full',
    385                         'width' => false,
     380                        'type'   => 'full',
     381                        'width'  => false,
    386382                        'height' => false,
    387                         'class' => 'avatar',
    388                         'id' => false,
    389                         'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name )
     383                        'class'  => 'avatar',
     384                        'id'     => false,
     385                        'alt'    => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name )
    390386                );
    391387
     
    439435}
    440436        function bp_get_group_permalink( $group = false ) {
    441                 global $groups_template, $bp;
     437                global $groups_template;
    442438
    443439                if ( empty( $group ) )
     
    451447}
    452448        function bp_get_group_admin_permalink( $group = false ) {
    453                 global $groups_template, $bp;
     449                global $groups_template;
    454450
    455451                if ( empty( $group ) )
     
    668664}
    669665        function bp_get_group_all_members_permalink( $group = false ) {
    670                 global $groups_template, $bp;
     666                global $groups_template;
    671667
    672668                if ( empty( $group ) )
     
    677673
    678674function bp_group_search_form() {
    679         global $groups_template, $bp;
     675        global $bp;
    680676
    681677        $action = $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/search/';
     
    721717}
    722718        function bp_get_groups_pagination_count() {
    723                 global $bp, $groups_template;
     719                global $groups_template;
    724720
    725721                $start_num = intval( ( $groups_template->pag_page - 1 ) * $groups_template->pag_num ) + 1;
    726                 $from_num = bp_core_number_format( $start_num );
    727                 $to_num = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
    728                 $total = bp_core_number_format( $groups_template->total_group_count );
     722                $from_num  = bp_core_number_format( $start_num );
     723                $to_num    = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
     724                $total     = bp_core_number_format( $groups_template->total_group_count );
    729725
    730726                return apply_filters( 'bp_get_groups_pagination_count', sprintf( __( 'Viewing group %1$s to %2$s (of %3$s groups)', 'buddypress' ), $from_num, $to_num, $total ) );
     
    10761072
    10771073function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
    1078         global $groups_template, $group_mods;
     1074        global $groups_template;
    10791075
    10801076        if ( empty( $group ) )
     
    11381134
    11391135function bp_group_has_moderators( $group = false ) {
    1140         global $group_mods, $groups_template;
     1136        global $groups_template;
    11411137
    11421138        if ( empty( $group ) )
     
    11501146}
    11511147        function bp_get_group_member_promote_mod_link( $args = '' ) {
    1152                 global $members_template, $groups_template, $bp;
     1148                global $members_template, $groups_template;
    11531149
    11541150                $defaults = array(
     
    11671163}
    11681164        function bp_get_group_member_promote_admin_link( $args = '' ) {
    1169                 global $members_template, $groups_template, $bp;
     1165                global $members_template, $groups_template;
    11701166
    11711167                $defaults = array(
     
    11891185}
    11901186        function bp_get_group_member_demote_link( $user_id = 0, $group = false ) {
    1191                 global $members_template, $groups_template, $bp;
     1187                global $members_template, $groups_template;
    11921188
    11931189                if ( empty( $group ) )
     
    12091205}
    12101206        function bp_get_group_member_ban_link( $user_id = 0, $group = false ) {
    1211                 global $members_template, $groups_template, $bp;
     1207                global $groups_template;
    12121208
    12131209                if ( empty( $group ) )
     
    12471243}
    12481244        function bp_get_group_member_remove_link( $user_id = 0, $group = false ) {
    1249                 global $members_template, $groups_template;
     1245                global $groups_template;
    12501246
    12511247                if ( empty( $group ) )
  • trunk/bp-groups/bp-groups-widgets.php

    r5574 r5689  
    2929
    3030        function widget( $args, $instance ) {
    31                 global $bp;
    32 
    3331                $user_id = apply_filters( 'bp_group_widget_user_id', '0' );
    3432
     
    143141
    144142function groups_ajax_widget_groups_list() {
    145         global $bp;
    146143
    147144        check_ajax_referer('groups_widget_groups_list');
     
    200197}
    201198add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
     199
    202200?>
Note: See TracChangeset for help on using the changeset viewer.