| 137 | |
| 138 | // if we're on a spammer's profile page, only users with the 'bp_moderate' cap |
| 139 | // can view subpages on the spammer's profile |
| 140 | // |
| 141 | // users without the cap trying to access a spammer's subnav page will get |
| 142 | // redirected to the root of the spammer's profile page. this occurs by |
| 143 | // by removing the component in the canonical stack. |
| 144 | if ( bp_is_user_spammer( bp_displayed_user_id() ) && ! bp_current_user_can( 'bp_moderate' ) ) { |
| 145 | unset( $bp->canonical_stack['component'] ); |
| 146 | } |