Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/10/2014 03:54:41 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Bracketize extensions, and missed a spot in the admin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/functions.php

    r5232 r5441  
    5757
    5858        // Easy empty checking
    59         if ( !empty( $user_id ) && is_numeric( $user_id ) )
     59        if ( !empty( $user_id ) && is_numeric( $user_id ) ) {
    6060                $bbp_user_id = $user_id;
     61        }
    6162
    6263        // Currently viewing or editing a user
    63         elseif ( ( true === $displayed_user_fallback ) && !empty( $did ) )
     64        elseif ( ( true === $displayed_user_fallback ) && !empty( $did ) ) {
    6465                $bbp_user_id = $did;
     66        }
    6567
    6668        // Maybe fallback on the current_user ID
    67         elseif ( ( true === $current_user_fallback ) && !empty( $lid ) )
     69        elseif ( ( true === $current_user_fallback ) && !empty( $lid ) ) {
    6870                $bbp_user_id = $lid;
     71        }
    6972
    7073        return $bbp_user_id;
     
    8184 */
    8285function bbp_filter_is_single_user( $is = false ) {
    83         if ( !empty( $is ) )
     86        if ( !empty( $is ) ) {
    8487                return $is;
     88        }
    8589
    8690        return bp_is_user();
     
    97101 */
    98102function bbp_filter_is_user_home( $is = false ) {
    99         if ( !empty( $is ) )
     103        if ( !empty( $is ) ) {
    100104                return $is;
     105        }
    101106
    102107        return bp_is_my_profile();
     
    293298
    294299        // Use current group if none is set
    295         if ( empty( $group_id ) )
     300        if ( empty( $group_id ) ) {
    296301                $group_id = bp_get_current_group_id();
     302        }
    297303
    298304        // Get the forums
    299         if ( !empty( $group_id ) )
     305        if ( !empty( $group_id ) ) {
    300306                $forum_ids = groups_get_groupmeta( $group_id, 'forum_id' );
     307        }
    301308
    302309        // Make sure result is an array
    303         if ( !is_array( $forum_ids ) )
     310        if ( !is_array( $forum_ids ) ) {
    304311                $forum_ids = (array) $forum_ids;
     312        }
    305313
    306314        // Trim out any empty array items
     
    322330
    323331        // Use current group if none is set
    324         if ( empty( $forum_id ) )
     332        if ( empty( $forum_id ) ) {
    325333                $forum_id = bbp_get_forum_id();
     334        }
    326335
    327336        // Get the forums
    328         if ( !empty( $forum_id ) )
     337        if ( !empty( $forum_id ) ) {
    329338                $group_ids = get_post_meta( $forum_id, '_bbp_group_ids', true );
     339        }
    330340
    331341        // Make sure result is an array
    332         if ( !is_array( $group_ids ) )
     342        if ( !is_array( $group_ids ) ) {
    333343                $group_ids = (array) $group_ids;
     344        }
    334345
    335346        // Trim out any empty array items
     
    348359
    349360        // Use current group if none is set
    350         if ( empty( $group_id ) )
     361        if ( empty( $group_id ) ) {
    351362                $group_id = bp_get_current_group_id();
     363        }
    352364
    353365        // Trim out any empties
     
    386398
    387399        // Use current group if none is set
    388         if ( empty( $group_id ) )
     400        if ( empty( $group_id ) ) {
    389401                $group_id = bp_get_current_group_id();
     402        }
    390403
    391404        // Get current group IDs
     
    411424
    412425        // Use current group if none is set
    413         if ( empty( $group_id ) )
     426        if ( empty( $group_id ) ) {
    414427                $group_id = bp_get_current_group_id();
     428        }
    415429
    416430        // Get current group IDs
     
    436450
    437451        // Use current group if none is set
    438         if ( empty( $group_id ) )
     452        if ( empty( $group_id ) ) {
    439453                $group_id = bp_get_current_group_id();
     454        }
    440455
    441456        // Get current group IDs
     
    461476
    462477        // Use current group if none is set
    463         if ( empty( $group_id ) )
     478        if ( empty( $group_id ) ) {
    464479                $group_id = bp_get_current_group_id();
     480        }
    465481
    466482        // Get current group IDs
     
    483499
    484500        // Use current group if none is set
    485         if ( empty( $group_id ) )
     501        if ( empty( $group_id ) ) {
    486502                $group_id = bp_get_current_group_id();
     503        }
    487504
    488505        // Get current group IDs
     
    556573
    557574        // Bail if user is not logged in or not looking at a group
    558         if ( ! is_user_logged_in() || ! bp_is_group() )
     575        if ( ! is_user_logged_in() || ! bp_is_group() ) {
    559576                return false;
     577        }
    560578
    561579        $bbp = bbpress();
    562580
    563581        // Set the global if not set
    564         if ( ! isset( $bbp->current_user->is_group_admin ) )
     582        if ( ! isset( $bbp->current_user->is_group_admin ) ) {
    565583                $bbp->current_user->is_group_admin = groups_is_user_admin( get_current_user_id(), bp_get_current_group_id() );
     584        }
    566585
    567586        // Return the value
     
    585604
    586605        // Bail if user is not logged in or not looking at a group
    587         if ( ! is_user_logged_in() || ! bp_is_group() )
     606        if ( ! is_user_logged_in() || ! bp_is_group() ) {
    588607                return false;
     608        }
    589609
    590610        $bbp = bbpress();
    591611
    592612        // Set the global if not set
    593         if ( ! isset( $bbp->current_user->is_group_mod ) )
     613        if ( ! isset( $bbp->current_user->is_group_mod ) ) {
    594614                $bbp->current_user->is_group_mod = groups_is_user_mod( get_current_user_id(), bp_get_current_group_id() );
     615        }
    595616
    596617        // Return the value
     
    614635
    615636        // Bail if user is not logged in or not looking at a group
    616         if ( ! is_user_logged_in() || ! bp_is_group() )
     637        if ( ! is_user_logged_in() || ! bp_is_group() ) {
    617638                return false;
     639        }
    618640
    619641        $bbp = bbpress();
    620642
    621643        // Set the global if not set
    622         if ( ! isset( $bbp->current_user->is_group_member ) )
     644        if ( ! isset( $bbp->current_user->is_group_member ) ) {
    623645                $bbp->current_user->is_group_member = groups_is_user_member( get_current_user_id(), bp_get_current_group_id() );
     646        }
    624647
    625648        // Return the value
     
    643666
    644667        // Bail if user is not logged in or not looking at a group
    645         if ( ! is_user_logged_in() || ! bp_is_group() )
     668        if ( ! is_user_logged_in() || ! bp_is_group() ) {
    646669                return false;
     670        }
    647671
    648672        $bbp = bbpress();
    649673
    650674        // Set the global if not set
    651         if ( ! isset( $bbp->current_user->is_group_banned ) )
     675        if ( ! isset( $bbp->current_user->is_group_banned ) ) {
    652676                $bbp->current_user->is_group_banned = groups_is_user_banned( get_current_user_id(), bp_get_current_group_id() );
     677        }
    653678
    654679        // Return the value
     
    672697
    673698        // Bail if user is not logged in or not looking at a group
    674         if ( ! is_user_logged_in() || ! bp_is_group() )
     699        if ( ! is_user_logged_in() || ! bp_is_group() ) {
    675700                return false;
     701        }
    676702
    677703        $bbp = bbpress();
    678704
    679705        // Set the global if not set
    680         if ( ! isset( $bbp->current_user->is_group_creator ) )
     706        if ( ! isset( $bbp->current_user->is_group_creator ) ) {
    681707                $bbp->current_user->is_group_creator = groups_is_user_creator( get_current_user_id(), bp_get_current_group_id() );
     708        }
    682709
    683710        // Return the value
Note: See TracChangeset for help on using the changeset viewer.