Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/14/2011 05:19:12 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Find/replace on is_super_admin() to use bp_current_user_can( 'bp_moderate' ). See #3740.

File:
1 edited

Legend:

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

    r5304 r5329  
    378378}
    379379
     380/**
     381 * Whether current user has a capability or role. Can be passed blog ID, or will
     382 * use the root blod by default
     383 *
     384 * @since BuddyPress (1.6)
     385 *
     386 * @param string $capability Capability or role name.
     387 * @param int $blog_id Blog ID
     388 * @return bool
     389 */
     390function bp_current_user_can( $capability, $blog_id = 0 ) {
     391
     392    // Use root blog if no ID passed
     393    if ( empty( $blog_id ) )
     394        $blog_id = bp_get_root_blog_id();
     395
     396    $retval = current_user_can_for_blog( $blog_id, $capability );
     397
     398    return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id );
     399}
     400
    380401?>
Note: See TracChangeset for help on using the changeset viewer.