bp_nouveau_rest_group_invites_get_items_permissions_check( true|WP_Error $retval, WP_REST_Request $request )

Makes sure the Nouveau specific behavior about Group invites visibility is applied to the REST API.


Parameters Parameters

$retval

(true|WP_Error) (Required) Whether the current user can list invites.

$request

(WP_REST_Request) (Required) The request sent to the API.


Top ↑

Return Return

(true|WP_Error) Whether the current user can list invites.


Source Source

File: bp-templates/bp-nouveau/includes/groups/functions.php

function bp_nouveau_rest_group_invites_get_items_permissions_check( $retval, $request ) {
	if ( is_wp_error( $retval ) ) {
		$group_id = (int) $request['group_id'];

		if ( groups_is_user_member( bp_loggedin_user_id(), $group_id ) ) {
			$retval = true;
		}
	}

	return $retval;
}


Top ↑

Changelog Changelog

Changelog
Version Description
7.2.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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