BP_REST_Members_Endpoint::can_manage_member( WP_User $user, string $action = 'delete' )
Can user manage (delete/update) a member?
Description
Parameters
- $user
-
(Required) User object.
- $action
-
(Optional) The action to perform (update or delete).
Default value: 'delete'
Return
(bool)
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( 'bp_moderate' ) || current_user_can( $capability, $user->ID ) ); }
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.