Skip to:
Content

bbPress.org

Changeset 4167


Ignore:
Timestamp:
08/24/2012 06:59:11 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Forums:

  • Remove superfluous is_super_admin() login in bbp_has_forums().
  • Capes always pass current_user_can() checks unless specifically not allowed, which is the intended behavior here.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-forum-template.php

    r3966 r4167  
    6262    $post_stati[] = bbp_get_public_status_id();
    6363
    64     // Super admin get whitelisted post statuses
    65     if ( is_super_admin() ) {
    66         $post_stati = array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id() );
    67 
    68     // Not a super admin, so check caps
    69     } else {
    70 
    71         // Check if user can read private forums
    72         if ( current_user_can( 'read_private_forums' ) )
    73             $post_stati[] = bbp_get_private_status_id();
    74 
    75         // Check if user can read hidden forums
    76         if ( current_user_can( 'read_hidden_forums' ) )
    77             $post_stati[] = bbp_get_hidden_status_id();
    78     }
     64    // Check if user can read private forums
     65    if ( current_user_can( 'read_private_forums' ) )
     66        $post_stati[] = bbp_get_private_status_id();
     67
     68    // Check if user can read hidden forums
     69    if ( current_user_can( 'read_hidden_forums' ) )
     70        $post_stati[] = bbp_get_hidden_status_id();
    7971
    8072    // The default forum query for most circumstances
Note: See TracChangeset for help on using the changeset viewer.