Skip to:
Content

BuddyPress.org

Ticket #6501: 6501.01.patch

File 6501.01.patch, 1.3 KB (added by thebrandonallen, 10 years ago)
  • src/bp-core/bp-core-caps.php

    diff --git src/bp-core/bp-core-caps.php src/bp-core/bp-core-caps.php
    index f6e30bb..ff383e8 100644
    function bp_set_current_user_default_role() { 
    268268function bp_current_user_can( $capability, $blog_id = 0 ) {
    269269
    270270        // Use root blog if no ID passed
    271         if ( empty( $blog_id ) )
     271        if ( empty( $blog_id ) ) {
    272272                $blog_id = bp_get_root_blog_id();
     273        }
     274
     275        $_args = array_slice( func_get_args(), 2 );
     276        $args  = array_merge( array( $blog_id, $capability ), $_args );
    273277
    274         $retval = current_user_can_for_blog( $blog_id, $capability );
     278        $retval = call_user_func_array( 'current_user_can_for_blog', $args );
    275279
    276280        /**
    277281         * Filters whether or not the current user has a given capability.
    function bp_current_user_can( $capability, $blog_id = 0 ) { 
    281285         * @param bool   $retval     Whether or not the current user has the capability.
    282286         * @param string $capability The capability being checked for.
    283287         * @param int    $blog_id    Blog ID. Defaults to the BP root blog.
     288         * @param array  $_args      Array of extra arguments passed.
    284289         */
    285         return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id );
     290        return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id, $_args );
    286291}
    287292
    288293/**