BuddyDev

Search

[Resolved] How to redirect to another user private message page ?

  • Participant
    Level: Initiated
    Posts: 10
    Thierry Bertrand on #24135

    Hello,

    After Creating a account using BP AJax registration,I need to redirect user to admin message private message page. To allow users to write directly.

    Any Solution please ?

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24136

    Hi Thierry,

    Thank you for the question.

    Please visit Dashboard->settings->Ajax Registration and click on “Register” tab.

    There you can set the url you want to redirect to.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Thierry Bertrand on #24139

    Hello,

    Thank You for your answer. But how to make this :

    1. User signup
    2. Uer is redected to admin page private message section already anebled
    3. User only have to write message.

    Cheers

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24149

    Hi Thierry,
    Do you want the user to be redirect to private message on their profile and where “admin” is selected as the receiver(send to)?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Thierry Bertrand on #24150

    Hello Brajesh,

    Yes it’s exactly what i need to do.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24264

    Hi Thierry,
    Thank you. It will need a dynamic url with nonce. I am going to push an update to ajax registration plugin and will post the code for it then.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Thierry Bertrand on #24291

    Hello,

    OK. Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24329

    Hi Thierry,

    We have released an update now.

    Please upgrade to 2.0.6

    https://buddydev.com/plugins/bp-ajax-registration/

    You can put this code in your bp-custom.php

    
    add_filter( 'bpajaxr_registration_redirect_url', function ( $redirect_url, $user_id ) {
    
    	return wp_nonce_url( bp_core_get_user_domain( $user_id) . bp_get_messages_slug() . '/compose/?r=admin' );
    }, 10, 2 );
    
    

    and it will do the redirection.

    PS:- I am asuming the username of administrator to be ‘admin’. If it is different, Please change accordingly.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Thierry Bertrand on #24331

    Hello,

    Thank you for this. Can you please tell me where to add that file ? Because i have issue when i place it on Wp-content/plugins/

    Regards

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24338

    Please make sure copy the code from my post and not from email notification.

    You can put the code in your activetheme/functions.php or in wp-content/plugins/bp-custom.php

    Regards
    Brajesh

The topic ‘ [Resolved] How to redirect to another user private message page ?’ is closed to new replies.

This topic is: resolved