Skip to:
Content

BuddyPress.org

Ticket #7192: 7192.get_current_user_id.patch

File 7192.get_current_user_id.patch, 633 bytes (added by r-a-y, 3 years ago)
  • src/bp-core/bp-core-caps.php

     
    276276                $args['site_id'] = bp_get_root_blog_id();
    277277        }
    278278
     279        /** This filter is documented in /bp-core/bp-core-template.php */
     280        $current_user_id = apply_filters( 'bp_loggedin_user_id', get_current_user_id() );
     281
    279282        // Call bp_user_can().
    280         $retval = bp_user_can( bp_loggedin_user_id(), $capability, $args );
     283        $retval = bp_user_can( $current_user_id, $capability, $args );
    281284
    282285        /**
    283286         * Filters whether or not the current user has a given capability.