Skip to:
Content

BuddyPress.org

Changeset 9945


Ignore:
Timestamp:
06/15/2015 08:48:29 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Core: Brackets and whitespace improvements to bp-core-caps.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-caps.php

    r9819 r9945  
    6666
    6767    // Load roles if not set
    68     if ( ! isset( $wp_roles ) )
     68    if ( ! isset( $wp_roles ) ) {
    6969        $wp_roles = new WP_Roles();
     70    }
    7071
    7172    // Loop through available roles and add them
     
    101102
    102103    // Load roles if not set
    103     if ( ! isset( $wp_roles ) )
     104    if ( ! isset( $wp_roles ) ) {
    104105        $wp_roles = new WP_Roles();
     106    }
    105107
    106108    // Loop through available roles and remove them
     
    200202            break;
    201203
    202         case 'editor'          :
    203         case 'author'          :
    204         case 'contributor'     :
    205         case 'subscriber'      :
    206         default                :
     204        // All other default WordPress blog roles
     205        case 'editor'      :
     206        case 'author'      :
     207        case 'contributor' :
     208        case 'subscriber'  :
     209        default            :
    207210            $caps = array();
    208211            break;
     
    240243
    241244    // Bail if not multisite or not root blog
    242     if ( ! is_multisite() || ! bp_is_root_blog() )
     245    if ( ! is_multisite() || ! bp_is_root_blog() ) {
    243246        return;
     247    }
    244248
    245249    // Bail if user is not logged in or already a member
    246     if ( ! is_user_logged_in() || is_user_member_of_blog() )
     250    if ( ! is_user_logged_in() || is_user_member_of_blog() ) {
    247251        return;
     252    }
    248253
    249254    // Bail if user is not active
    250     if ( bp_is_user_inactive() )
     255    if ( bp_is_user_inactive() ) {
    251256        return;
     257    }
    252258
    253259    // Set the current users default role
     
    269275
    270276    // Use root blog if no ID passed
    271     if ( empty( $blog_id ) )
     277    if ( empty( $blog_id ) ) {
    272278        $blog_id = bp_get_root_blog_id();
     279    }
    273280
    274281    $retval = current_user_can_for_blog( $blog_id, $capability );
     
    300307 *
    301308 * This implementation of 'bp_moderate' is temporary, until BuddyPress properly
    302  * matches caps to roles and stores them in the database. Plugin authors: Do
    303  * not use this function.
     309 * matches caps to roles and stores them in the database.
     310 *
     311 * Plugin authors: Please do not use this function; thank you. :)
    304312 *
    305313 * @access private
     
    316324
    317325    // Bail if not checking the 'bp_moderate' cap
    318     if ( 'bp_moderate' !== $cap )
     326    if ( 'bp_moderate' !== $cap ) {
    319327        return $caps;
     328    }
    320329
    321330    // Bail if BuddyPress is not network activated
    322     if ( bp_is_network_activated() )
     331    if ( bp_is_network_activated() ) {
    323332        return $caps;
     333    }
    324334
    325335    // Never trust inactive users
    326     if ( bp_is_user_inactive( $user_id ) )
     336    if ( bp_is_user_inactive( $user_id ) ) {
    327337        return $caps;
     338    }
    328339
    329340    // Only users that can 'manage_options' on this site can 'bp_moderate'
Note: See TracChangeset for help on using the changeset viewer.