Problem with new registered users

User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Problem with new registered users

Post by axew3 »

you would like that the user is redirected to a custom page after confirmation on buddypress (or anther that use same filter).
The code you provide work fine on my test.
As documented, it may should be added into bp-custom.php file, do not know if work in this case with wp_w3all, but should also
https://codex.buddypress.org/themes/bp-custom-php/

by the way, i've instead try it adding on fly the code into wp_w3all.php file
(think already suggested in another post)
so search for this code:

Code: Select all

   } // end PHPBB_INSTALLED
} // end not in admin

  if ( defined('PHPBB_INSTALLED') ){ 
ADD immediately after:

Code: Select all

  add_action( 'bp_core_activated_user', 'wpse_70289_activated_user_redirect' );

function wpse_70289_activated_user_redirect() {
   // $page = 'activation-reussie';//your page slug
    bp_core_redirect( "http://localhost/wp47/2017/03/12/hello-world/" );
}	
change http://localhost/wp47/2017/03/12/hello-world/ with URL to your page.
you'll see this will work. So you was passing the value to be redirect to, in wrong way, because with direct link, it work fine.
The code should be applied into bp-custom.php file as above mentioned, to avoid it is deleted when updating wp_w3all plugin. So try the procedure, or remember to re-add the above working test, into your wp_w3all.php.
antoinegdln4
User www
User www
Posts: 70
Joined: Fri Nov 11, 2016 3:50 pm

Re: Problem with new registered users

Post by antoinegdln4 »

The redirection after activation, is working fine. No problem with that.

The problem is after the FIRST CONNECTION.

On the page mentionned before (redirected after activation) :

The user can press a button to logg-in :

Image

Then, he can logg in

Image

But, that logg-in link is a redirection to a welcome page after first connection.

Link on the logg-in button is :

http://tankistesdelombre.fr/wp-login.ph ... es-ltdo%2F
---> custom redirection after connection

It is not a simple http://website.com/wp-login.php, i added a redirection on this button / link.

But that's not working, user is redirected on WP Admin Panel :shock: :o

:shock: :o
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Problem with new registered users

Post by axew3 »

Code: Select all

http://tankistesdelombre.fr/wp-login.php?redirect_to=http://tankistesdelombre.fr/rejoindre-les-ltdo/
return me to the wp-login default page.
can you provide the link that should be instead?
what's the page name to welcome the new user?
see on wp pages and choose see page so let know the url of this page
antoinegdln4
User www
User www
Posts: 70
Joined: Fri Nov 11, 2016 3:50 pm

Re: Problem with new registered users

Post by antoinegdln4 »

The "welcome page" is http://tankistesdelombre.fr/rejoindre-les-ltdo/

Note : The problem is only AFTER FIRST CONNECTION --> New users are redirected to WP Admin Panel after first connection (instead of my welcome page as should it be).

So, there's the path :

User Registration --> Custom Page ("You have to click on activation mail") --> Mailbox / Click on Activation mail ---> Custom Page "Account Activated, please Logg-in" . (On this page, user click on a log-in button who should redirect him to my "welcome page") --> Logg-in Button --> Redirection to "Welcome page" , but FAIL , redirect the user to WP Admin Panel (User Panel).
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Problem with new registered users

Post by axew3 »

so Antoine, if you into wp_w3all.php file, exactly just after lines

Code: Select all

   } // end PHPBB_INSTALLED
} // end not in admin

  if ( defined('PHPBB_INSTALLED') ){ 
you ADD this:

Code: Select all

add_action( 'bp_core_activated_user', 'wpse_70289_activated_user_redirect' );

function wpse_70289_activated_user_redirect() {
    bp_core_redirect( "http://tankistesdelombre.fr/rejoindre-les-ltdo/" );
}	
do not work?

the procedure you indicated is how i should go to setup buddypress and test the thing?
antoinegdln4
User www
User www
Posts: 70
Joined: Fri Nov 11, 2016 3:50 pm

Re: Problem with new registered users

Post by antoinegdln4 »

That should work... i will make some tests later ;)

Yeah, it was for you, ... as you can see how my path for "new users" is. ;)
Post Reply