Opened 4 years ago
Closed 3 years ago
#8423 closed defect (bug) (worksforme)
About the filter: bp_nouveau_current_user_can
Reported by: | dunhakdis | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 7.1.0 |
Component: | Core | Keywords: | |
Cc: |
Description
Hi everyone, I'm not sure how if this is a bug or this is how it intended to work but I'm confuse with how bp_nouveau_current_user_can filter works.
<?php // return is being overwritten by the the next filter. Returns true instead of false. add_filter("bp_nouveau_current_user_can", function( $is_loggedin, $cap, $uid ){ if ( $cap === "publish_activity" ) { return false; } return $is_loggedin; }, 20, 3); // overwiting previous filter. add_filter("bp_nouveau_current_user_can", function( $is_loggedin, $cap, $uid ){ if ( $cap === "comment_activity" ) { return true; } return $is_loggedin; }, 20, 3);
When on activity stream, the previous filter is being overwritten regardless of $cap.
Thanks!
Change History (1)
Note: See
TracTickets for help on using
tickets.
It works as expected for me. Using the above filter a user cannot publish new activities but can comment existing ones.