Tagged: user self activate action
Hi,
I just purchased the deactivate plugin. Our theme hides the toolbar for users other than admin. Can you advise how we can add an activate link or button somewhere in the bottom notice or header (like the admin deactivate button) that a user can access only if their own profile is deactivated so that they can activate it?
Thank you!
Hi Jacqui,
Thank you for purchasing the plugin.Please put this code in your theme’s functions.php or in the wp-content/plugins/bp-custom.php
add_filter( 'bp_account_deactivator_user_can_change_account_status', function ( $allow ) { return bp_is_my_profile() || is_super_admin(); } );
That will show the activate/deactivate button on Member Profile header.
Regards
BrajeshHi Thanks for the quick reply. Unfortunately, the user still can’t see a way to activate his account.
In addition, I have noticed that the admin deactivating an account logs the user out of WordPress without that option being set in the settings.
Any help would be appreciated.
Thanks!
Hi Jacqui,
I am sorry i could not reply earlier. I will update the plugin today and provide you the way to use button via code anywhere.The above code should insert the button in user’s header(where the friend/other buttons are shown).
Regards
BrajeshHi,
Thank you! I don’t know if it makes a difference but I am using the legacy templates, I see the friend button, messaging and the activate/deactivate button for the admin, but not for the user. Presumably the user button should be in the same place.
Also, could you possibly take a look at the persistence of the message bar along the bottom, as it pops up on accounts that are already active with a message to activate the account. It only seems to disappear if I hard refresh my browser (Ctrl+F5). I have disabled caching for the members pages in WP Rocket. Then when I view another profile that is already activated the message reappears.
Thank you!
Hi Jacqui,
The button works for both the templates while using the above code.
Please see the screenshotshttps://i.imgur.com/j1oE85Y.png
https://i.imgur.com/lrZLQFR.pngI will look at the persistent message a bit late today(leaving work for now) and will get back to you.
regards
BrajeshHi,
Is there an ETA when these fixes will be released?
In the theme I am using only the admin has an activate link and it appears in the header section. Presumably the user link should be in the same position with this filter, but it is not.
Admin Activate user button: https://imgur.com/DC2Xc1s
Thanks!
Hi Jacqui,
Are you using the code from above?You are right, the user button should be in the same place. That code should make it appear.
Can you please put the code and recheck?
Before we push any update, we need to understand the issue.
PS:- The deactivation can also be dome from Profile->settings screen.
Regards
BrajeshThe deactivate button for when users want to deactivate their profile is present, but we need to enable users to activate their own profile. We will be deactivating all profiles by default so only users who want an active profile should activate their own profile and be in the members directory. Your code is in the functions.php in the child theme.
Thank you for the details.
Just 1 more question.Did you login with a deactivated user account? If yes, didn’t their profile show an “Activate” button? It should be at the same place where deactivate is.
If it is not showing. Please let me know. It could be a bug. I will be testing the same today too and update you.
Regards
Brajesh
You must be logged in to reply to this topic.