BuddyDev

Search

[Resolved] Create a popup for letting the user know that the account has been deleted?


  • Participant
    Level: Master
    Posts: 254
    Daniel on #31958

    Hi,

    When a user deletes his BP account, he gets redirected to the mainpage which can be set in BP Dashboard. Would it be possible to create a page saying that the account has been successfully deleted or with a pop up window?
    Or is the best way just to add a page with saying that the account has been deleted successfully and let the user redirect to that page?

    Thanks for your suggestion.

    Regards
    Daniel


  • Participant
    Level: Master
    Posts: 214
    Tosin on #31975

    I think a custom page redirect would be better, maybe a custom page with the url slug as (account-deleted) and a message in the page stating that user account has been deleted.


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #31985

    Hi Daniel,
    I agree with what Tosin suggested. Using a custom page is a good idea.

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 254
    Daniel on #31999

    Hi guys,

    Ok thanks I thought so too. Currently I can’t find it where I can change the slug to redirect the user to the account deleted page.

    Would it be possible to point me where I can make the slug change so then I can set up the account deletion page?

    Thank you and have a nice day.

    Regards
    Daniel


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #32011

    Hi Daniel,
    you may use the following code to do that.

    
    
    /**
     * Redirect user to a page after account deletion.
     */
    add_action( 'bp_core_deleted_account', function () {
    
    	// $url = "http://yoursite.com/some-page/";
    	$url = site_url( '/account-deleted/' );
    
    	bp_core_redirect( $url );
    } );
    
    

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 254
    Daniel on #32150

    Hi Brajesh,

    Thanks for the code. I am currently creating the Account Deletion page and will try it out when finished.

    I will let you know.

    Thanks and Regards,
    Daniel


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #32157

    Hi Daniel,
    You are welcome.

    I hope it works for you. All the best.

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 254
    Daniel on #32170

    Hi Braiesh,

    The Code provide from you worked flawlessly.

    Thank you!

    Regards
    Daniel


  • Participant
    Level: Master
    Posts: 254
    Daniel on #32174

    Yo hi,

    I thought I could use the same technique for account deactivation.

    Would it be doable to also redirect the user when deactivating the account to a customized page saying that the account was deactivated for now?

    Thanks for your input.

    Regards
    Daniel


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #32178

    Hi Daniel,
    Thank you for confirming that it works.

    If you are using our BuddyPress Account deactivator plugin, you can setup the url in plugin’s admin setting.

    PS:- In future, Please open a new topic for different question. That helps us in keeping the forums meaningful for members having same issue in future.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved
Subscribe