BP_REST_Groups_Endpoint::can_see_hidden_groups( WP_REST_Request $request )

Can this user see hidden groups?


Parameters Parameters

$request

(WP_REST_Request) (Required) Full details about the request.


Top ↑

Return Return

(bool)


Source Source

File: bp-groups/classes/class-bp-rest-groups-endpoint.php

	protected function can_see_hidden_groups( $request ) {
		if ( bp_current_user_can( 'bp_moderate' ) ) {
			return true;
		}

		return (
			is_user_logged_in()
			&& isset( $request['user_id'] )
			&& absint( $request['user_id'] ) === bp_loggedin_user_id()
		);
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.