[buddypress-trac] [BuddyPress Trac] #6501: Allow additional arguments to be passed to bp_current_user_can()
buddypress-trac
noreply at wordpress.org
Fri Jun 19 14:51:17 UTC 2015
#6501: Allow additional arguments to be passed to bp_current_user_can()
------------------------------------+------------------
Reporter: thebrandonallen | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.4
Component: API - Roles/Capability | Version: 1.6
Severity: normal | Resolution:
Keywords: has-patch |
------------------------------------+------------------
Comment (by boonebgorges):
@r-a-y - Thanks for your patch. I was going to suggest the very same
thing, in response to thebrandonallen's patch on #5121.
`bp_current_user_can()` is still slightly different from
`current_user_can()`, because `current_user_can()` can take a scalar as
the item_id/third argument. So,
{{{
current_user_can( 'edit_post', $post_id );
}}}
vs
{{{
bp_current_user_can( 'edit_group', array( 'item_id' => $group_id ) ); //
or 'group_id' or whatever
}}}
There's probably no way around this, since (a) some caps may require more
than one item id, and (b) we need to provide backward compatibility for
`$blog_id`, but just thought I'd raise the point.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6501#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list