Please or Register to create posts and topics.

Change URLs (Login, Register, Profile, etc)

12

If you are using custom pages for certain areas of your website and you want to change specific URLs, you have to use one of the available filter which are provided by WordPress or Asgaros Forum. Here are a few code-examples which you have to add to your themes functions.php-file.

Change Login URL

add_filter('login_url', 'my_login_url', 10, 3);

function my_login_url($login_url, $redirect, $force_reauth) {
    return home_url('/my-login-page');
}

 

Change Register URL

add_filter('register_url', 'my_register_url');

function my_register_url($register_url) {
    return home_url('/my-register-page');
}

 

Change Members List URL

add_filter('asgarosforum_filter_members_link', 'my_members_list_url');

function my_members_list_url($members_list_url) {
    return home_url('/my-members-page');
}

 

Change Profile URL

add_filter('asgarosforum_filter_profile_link', 'my_profile_url', 10, 2);

function my_profile_url($profile_url, $user_object) {
    return home_url('/my-profile-page/'.$user_object->user_nicename);
}

 

Change Edit Profile URL

add_filter('edit_profile_url', 'my_edit_profile_url', 10, 3);

function my_edit_profile_url($url, $user_id, $scheme) {
    return home_url('/my-edit-profile-page/'.$user_id);
}

 

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Gibt es einen Code für die Funktion das sobald man auf ein Username klickt das dieser zum BuddyPress Profil weitergeleitet wird?

@samuel

Das letzte Beispiel sollte dir weiterhelfen. Wie der Code genau aussieht, kann ich dir leider nicht sagen, da ich die BuddyPress-API nicht kenne. Ich denke, dass dir deren Support-Forum ein Code-Beispiel liefern kann, welches weiterhilft. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Please help me set this up. I have Ultimate Member and this didn't work.

I added the following to my functions.php

 

add_filter('login_url', 'my_login_url', 10, 3);

 

function my_login_url($login_url, $redirect, $force_reauth) {

return home_url('/login');

}

 

This worked for anyone trying to go to my_site/wp-admin/, but it didn't work for the Forum link to login. Please add in a way to change the links YOU have there.

Hello @maxter

This seems to be a WordPress problem. The code is working fine with any URL as long as it is not /login. Maybe you can use a different URL-slug, for example /login-page.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Thank you, Asgaros, it worked. I apologize for not trying that before, it hadn't crossed my mind

Hallo,

ich habe die Schnippel nun erfolgreich eingefügt; aber der Erfolg bleibt aus. Die Links wollen noch immer zum WP-Login.

Hallo @cooper86

Der Code sollte ohne Probleme funktionieren. Wenn dies nicht der Fall ist, dann pfuscht ein anderes Plugin oder dein Theme dazwischen.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Danke für die Antwort.

Da ich ein Seiten-Widget mit Login habe, habe ich dies im Forum-Menü einfach deaktiviert. Danke das es auch diese Möglichkeit gibt 😃

I know this is an old thread but I have a question:

Let's say my custom login url is "https://mysite.com/login23

Now which part from the Change Login URL posted above should I change before adding it to functions.php?

Thank you for this awesome plugin 🙂

Update: There is an option in settings to change url for both login and registration 🙂

So nvm .

 

12