Skip to:
Content

BuddyPress.org

Ticket #7192: 7192.04.backcompat.patch

File 7192.04.backcompat.patch, 607 bytes (added by dcavins, 3 years ago)

Fix backcompat for old-style arguments.

  • src/bp-core/bp-core-caps.php

    diff --git src/bp-core/bp-core-caps.php src/bp-core/bp-core-caps.php
    index 9b59eec..cd719f1 100644
    function bp_set_current_user_default_role() { 
    257257function bp_current_user_can( $capability, $args = array() ) {
    258258        // Backward compatibility for older $blog_id parameter.
    259259        if ( is_int( $args ) ) {
    260                 $blog_id = $args;
     260                $site_id = $args;
    261261                $args = array();
    262                 $args['site_id'] = $args;
     262                $args['site_id'] = $site_id;
    263263
    264264        // New format for second parameter.
    265265        } elseif ( is_array( $args ) && isset( $args['blog_id'] ) ) {