BP_REST_Groups_Endpoint::can_see_hidden_groups( WP_REST_Request $request )
Can this user see hidden groups?
Description
Parameters
- $request
-
(Required) Full details about the request.
Return
(bool)
Source
File: bp-groups/classes/class-bp-rest-groups-endpoint.php
protected function can_see_hidden_groups( $request ) { if ( $request['show_hidden'] ) { if ( bp_current_user_can( 'bp_moderate' ) ) { return true; } if ( is_user_logged_in() && isset( $request['user_id'] ) && absint( $request['user_id'] ) === bp_loggedin_user_id() ) { return true; } return false; } return true; }
Changelog
Version | Description |
---|---|
0.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.