BuddyDev

Search

Activate Button for users with no toolbar

  • Participant
    Level: Initiated
    Posts: 7
    Jacqui Dervan on #25866

    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!

  • Keymaster
    (BuddyDev Team)
    Posts: 22172
    Brajesh Singh on #25867

    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
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Jacqui Dervan on #25877

    Hi 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!

  • Keymaster
    (BuddyDev Team)
    Posts: 22172
    Brajesh Singh on #25896

    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
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Jacqui Dervan on #25899

    Hi,

    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!

  • Keymaster
    (BuddyDev Team)
    Posts: 22172
    Brajesh Singh on #25908

    Hi Jacqui,

    The button works for both the templates while using the above code.
    Please see the screenshots

    https://i.imgur.com/j1oE85Y.png
    https://i.imgur.com/lrZLQFR.png

    I will look at the persistent message a bit late today(leaving work for now) and will get back to you.

    regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Jacqui Dervan on #26020

    Hi,

    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!

  • Keymaster
    (BuddyDev Team)
    Posts: 22172
    Brajesh Singh on #26033

    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
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Jacqui Dervan on #26035

    The 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.

  • Keymaster
    (BuddyDev Team)
    Posts: 22172
    Brajesh Singh on #26036

    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.

This topic is: not resolved