BP_REST_Members_Endpoint::can_manage_member( WP_User $user, string $action = 'delete' )

Can user manage (delete/update) a member?


Parameters Parameters

$user

(WP_User) (Required) User object.

$action

(string) (Optional) The action to perform (update or delete).

Default value: 'delete'


Top ↑

Return Return

(bool)


Source Source

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

	protected function can_manage_member( $user, $action = 'delete' ) {
		$capability = 'delete_user';

		if ( 'update' === $action ) {
			$capability = 'edit_user';
		}

		return current_user_can( $capability, $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.