[buddypress-trac] [BuddyPress Trac] #7192: Improve $args included in `bp_current_user_can` and `bp_user_can` filters.

buddypress-trac noreply at wordpress.org
Wed Sep 14 20:36:32 UTC 2016


#7192: Improve $args included in `bp_current_user_can` and `bp_user_can` filters.
-------------------------------------------+-----------------------
 Reporter:  dcavins                        |       Owner:  dcavins
     Type:  defect (bug)                   |      Status:  reopened
 Priority:  normal                         |   Milestone:  2.7
Component:  Core                           |     Version:  1.6
 Severity:  normal                         |  Resolution:
 Keywords:  dev-feedback has-patch commit  |
-------------------------------------------+-----------------------

Comment (by r-a-y):

 `get_current_user_id.patch` fixes the `bp_current_user_can( 'bp_moderate'
 )` issue.

 Problem was due to using `bp_loggedin_user_id()` instead of
 `get_current_user_id()`.  If we use `bp_current_user_can()` earlier than
 when `bp_loggedin_user_id()` is initialized, the user ID would be `0`,
 which is wrong.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7192#comment:17>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list