BuddyPress Deactivate Account plugin allows users to deactivate/reactivate their account on a BuddyPress based social network. With this plugin, you allow your users to remove themself from any social activity or visibility. This plugin allows them to reactivate their account later without loosing any data.
This plugin can also be used to block users from logging to a BuddyPress site.
- Allow users to deactivate/reactivate account
- Allow site admins to deactivate/reactivate user account
- Allow site admins to block users from logging in
- Option to automatically logout on deactivation(User will be logged out from all devices/sessions).
- Option to automatically activate account on login
- Option to send email notification to site admins and users on account activation/deactivation.
- Easy to use admin panel
- 100% translatable
You can use this plugin to let users activate/deactivate their account or as a tool to block users from your site.
When an account is deactivated:-
- The deactivated user can not perform any action unless their account is active again.
- Deactivated user's activities are hidden from all user
- Deactivated user's profile is hidden from all users
- Deactivated user can not receive/send friendship requests or messages
- Deactivated users can not login(If admin enables this option).
This plugin will work if you have BuddyPress Settings component enabled.
Front end account:-
Admin filtering and status updates:-
Account deactivate message:-
If admin has allowed users to activate/deactivate their account, a user can deactivate/reactivate their account by visiting settings page from their profile.
BuddyPress Deactivate Account Plugin API:-
The BuddyPress deactivate account plugin provides simple api for activating, deactivating account and checking the status of the account using a few lines of code.
Mark a user account inactive:-
bp_account_deactivator()->set_inactive( $user_id );
Mark the user account active:-
bp_account_deactivator()->set_active( $user_id );
Check if a user account is inactive:-
bp_account_deactivator()->is_inactive( $user_id );
Check if a user account is active:-
You can use the previous function with a negation, or use the following function:-
bp_account_deactivator()->is_active( $user_id );
Check if logged in user's account is inactive:-
You can either use bp_account_deactivator()->is_inactive( get_current_user_id() ) or you can use the following:-
The benefit of using is_logged_user_inactive() is that it stores the state in a static variable and repeatative calls are inexpensive.
Check if displayed user account is inactive:-
Like the logged in account, you can check for this using bp_account_deactivator()->is_inactive( bp_displayed_user_id() ) or the following call
The benefit of using is_displayed_user_inactive() is better performance on repetitive calls.
CSS Classes in Body:-
The following css classes are added on 'body' element based on user status.
- For inactive logged in user :- bp-deactivator-logged-inactive
- For active logged in user:- bp-deactivator-logged-active
- For inactive displayed user:- bp-deactivator-displayed-inactive
- For active displayed user:- bp-deactivator-displayed-active
You can use it to target and style specific elements if you wish to do so.