BuddyDev

Search

[Resolved] buddypress Deactivate Account Plugin

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #19477

    Thank you for reminding. Please put the folling code in your bp-custom.php or your theme’s functions.php

    
    
    /**
     * Show Deactivate/Activate button in directory
     */
    function buddydev_show_deactivate_account_button_in_dir() {
    
    	if ( ! is_super_admin() ) {
    		return;
    	}
    
    	if ( ! class_exists( 'BP_Account_Deactivator_Action_Hooks' ) || ! method_exists( 'BP_Account_Deactivator_Action_Hooks', 'get_instance' ) ) {
    		return;
    	}
    
    	$instance = BP_Account_Deactivator_Action_Hooks::get_instance();
    
    	echo $instance->get_button( bp_get_member_user_id() );
    }
    
    add_action( 'bp_directory_members_actions', 'buddydev_show_deactivate_account_button_in_dir' );
    
    

    That will do it.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 4
    Jack Kelly on #21358

    Hey,

    Not sure if this is the correct place but thought it would be pointless to create a new topic. Is there anyway we can add a link for the user to go straight to the account deactivator settings? When i’m on my profile page it’s not entirely clear where I can reactivate my account. I’d like to amend the “public function notice()” in the “class-members-hooks.php” file. It currently reads….

    bp_core_add_message( __( ‘Your account is inactive. Please activate it to use all site functionality.’, ‘bp-deactivate-account’ ), ‘error’ );

    It would be nice to add a link to the “settings/account-deactivator/” page.

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #21363

    Hi Jack,
    Thank you for the post and the suggestion.

    Please feel free to do that. You can modify that line and use this instead

    
    	bp_core_add_message( sprintf( __( 'Your account is inactive. Please <a href="%s">activate</a> it to use all site functionality.', 'bp-deactivate-account' ),  bp_loggedin_user_domain() . bp_get_settings_slug() . '/account-deactivator/' ), 'error' );
    

    PS:- Please open a new topic in future to allow us keep the forum organized and help you server better.
    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 4
    Jack Kelly on #21377

    Thanks Brajesh 🙂

    sure I will open a new topic in future 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #21386

    No problem.
    You are welcome 🙂

The topic ‘ [Resolved] buddypress Deactivate Account Plugin’ is closed to new replies.

This topic is: resolved