Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/10/2015 02:49:16 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Replace all remaining $bp global touches with buddypress().

All existing tests continue to pass as normal. I will further manually scrutinize each replacement to ensure correctness.

Fixes #5138. Any stragglers or updates will reference this ticket.

File:
1 edited

Legend:

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

    r9462 r9471  
    142142 */
    143143function groups_add_forum_tables_sql( $sql = '' ) {
    144         global $bp;
     144        $bp = buddypress();
    145145
    146146        $sql .= 'JOIN ' . $bp->groups->table_name . ' AS g LEFT JOIN ' . $bp->groups->table_name_groupmeta . ' AS gm ON g.id = gm.group_id ';
     
    156156 */
    157157function groups_add_forum_where_sql( $sql = '' ) {
    158         global $bp;
    159158
    160159        // Define locale variable
     
    190189        // Assemble Voltron
    191190        $parts_string = implode( ' AND ', $parts );
     191
     192        $bp = buddypress();
    192193
    193194        // Set it to the global filter
     
    207208 */
    208209function groups_filter_bbpress_caps( $value, $cap, $args ) {
    209         global $bp;
    210210
    211211        if ( bp_current_user_can( 'bp_moderate' ) )
    212212                return true;
    213213
    214         if ( 'add_tag_to' == $cap )
    215                 if ( $bp->groups->current_group->user_has_access ) return true;
     214        if ( 'add_tag_to' === $cap ) {
     215                $bp = buddypress();
     216
     217                if ( $bp->groups->current_group->user_has_access ) {
     218                        return true;
     219                }
     220        }
    216221
    217222        if ( 'manage_forums' == $cap && is_user_logged_in() )
Note: See TracChangeset for help on using the changeset viewer.