Opened 7 years ago
Closed 7 years ago
#3186 closed enhancement (fixed)
bbp_check_for_duplicate() - Switch current_user_can() to user_can()?
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6 | Priority: | high |
Severity: | normal | Version: | 2.0 |
Component: | General - Content Creation | Keywords: | has-patch commit |
Cc: |
Description
I use the bbp_check_for_duplicate()
function in a plugin of mine. However, my plugin is mostly used in logged-out instances.
bbp_check_for_duplicate()
has a check to see if the current user can bypass the throttle setting with current_user_can( 'throttle' )
.
Would it be suitable to change this to user_can()
instead? That way, this function can be used outside of logged-in instances.
Attached patch switches out current_user_can( 'throttle' ) for user_can( (int) $r['post_author'], 'throttle' )
. Throttle check uses the post author ID.
Let me know what you think.
In 6753: