Skip to:
Content

bbPress.org

Changeset 843


Ignore:
Timestamp:
06/06/2007 05:59:00 PM (18 years ago)
Author:
mdawaffe
Message:

bb_current_user_can hook with warning. Props so1o, fixes #640

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/capabilities.php

    r793 r843  
    470470    $args = array_merge(array($capability), $args);
    471471
    472     if ( empty($bb_current_user) )
    473         return false;
    474 
    475     return call_user_func_array(array(&$bb_current_user, 'has_cap'), $args);
     472    if ( empty($bb_current_user) ) {
     473        $retvalue = false;
     474    } else {
     475        $retvalue = call_user_func_array(array(&$bb_current_user, 'has_cap'), $args);
     476    }
     477   
     478    // Use bb_user_has_cap whenever possible!  This will not work everywhere.
     479    return apply_filters('bb_current_user_can', $retvalue, $capability, $args);
    476480}
    477481
Note: See TracChangeset for help on using the changeset viewer.