Skip to:
Content

BuddyPress.org

Opened 7 weeks ago

#8423 new defect (bug)

About the filter: bp_nouveau_current_user_can

Reported by: dunhakdis Owned by:
Milestone: Awaiting Review 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 (0)

Note: See TracTickets for help on using tickets.