Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/11/2014 09:54:15 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Breathing room for ! usages in Users component.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/capabilities.php

    r5436 r5442  
    6363
    6464    // User exists
    65     if ( !empty( $user ) ) {
     65    if ( ! empty( $user ) ) {
    6666
    6767        // Get users forum role
     
    8181
    8282            // Add the new role
    83             if ( !empty( $new_role ) ) {
     83            if ( ! empty( $new_role ) ) {
    8484
    8585                // Make sure bbPress roles are added
     
    128128        // smart, but since roles aren't exactly hierarchical, and bbPress
    129129        // does not yet have a UI for multiple user roles, it's fine for now.
    130         if ( !empty( $roles ) ) {
     130        if ( ! empty( $roles ) ) {
    131131            $role = array_shift( $roles );
    132132        }
     
    161161
    162162        // Look for a non bbPress role
    163         $roles     = array_intersect(
     163        $roles = array_intersect(
    164164            array_values( $user->roles ),
    165165            array_keys( bbp_get_blog_roles() )
     
    169169        // smart, but since roles aren't exactly hierarchical, and WordPress
    170170        // does not yet have a UI for multiple user roles, it's fine for now.
    171         if ( !empty( $roles ) ) {
     171        if ( ! empty( $roles ) ) {
    172172            $role = array_shift( $roles );
    173173        }
     
    371371
    372372    // Check if spam
    373     } elseif ( !empty( $user->spam ) ) {
     373    } elseif ( ! empty( $user->spam ) ) {
    374374        $is_spammer = true;
    375375    }
     
    405405
    406406    // Use displayed user if it's not yourself
    407     if ( empty( $user_id ) && bbp_is_single_user() && !bbp_is_user_home() ) {
     407    if ( empty( $user_id ) && bbp_is_single_user() && ! bbp_is_user_home() ) {
    408408        $user_id = bbp_get_displayed_user_id();
    409409    }
     
    444444
    445445        // Loop through posts and spam them
    446         if ( !empty( $posts ) ) {
     446        if ( ! empty( $posts ) ) {
    447447            foreach ( $posts as $post_id ) {
    448448
     
    496496
    497497    // Use displayed user if it's not yourself
    498     if ( empty( $user_id ) && bbp_is_single_user() && !bbp_is_user_home() ) {
     498    if ( empty( $user_id ) && bbp_is_single_user() && ! bbp_is_user_home() ) {
    499499        $user_id = bbp_get_displayed_user_id();
    500500    }
     
    535535
    536536        // Loop through posts and spam them
    537         if ( !empty( $posts ) ) {
     537        if ( ! empty( $posts ) ) {
    538538            foreach ( $posts as $post_id ) {
    539539
     
    592592
    593593    // Check if deleted
    594     } elseif ( !empty( $user->deleted ) ) {
     594    } elseif ( ! empty( $user->deleted ) ) {
    595595        $is_deleted = true;
    596596    }
     
    663663
    664664    // Return the inverse of active
    665     return !bbp_is_user_active( $user_id );
     665    return ! bbp_is_user_active( $user_id );
    666666}
    667667
Note: See TracChangeset for help on using the changeset viewer.