BP_Groups_Member::promote( string $status = 'mod' )
Promote a member to a new status.
Description
Parameters
- $status
-
(Optional) The new status. 'mod' or 'admin'.
Default value: 'mod'
Return
(bool) True on success, false on failure.
Source
File: bp-groups/classes/class-bp-groups-member.php
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | public function promote( $status = 'mod' ) { if ( 'mod' == $status ) { $this ->is_admin = 0; $this ->is_mod = 1; $this ->user_title = __( 'Group Moderator' , 'buddyboss' ); } if ( 'admin' == $status ) { $this ->is_admin = 1; $this ->is_mod = 0; $this ->user_title = __( 'Group Organizer' , 'buddyboss' ); } return $this ->save(); } |
Changelog
Version | Description |
---|---|
BuddyPress 1.6.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.