Please or Register to create posts and topics.

Link to Ultimate Member Profiles

PreviousPage 2 of 4Next

Hi MrVector,

You can add the following to your theme’s functions.php file:

add_filter( 'register_url', 'my_register_page' );
function my_register_page( $register_url ) {
    return home_url( '/register/' );
}

This works well with the Ultimate Member plugin.

Asgaros and Bluerainbow have reacted to this post.
AsgarosBluerainbow

Hello!

After UM upgrade old links made with code from your first answer do not works properly

Let me explain – Links from forum (Menu > USERS LIST and MY PROFILE) and  have no slash after username and after click on link page redirect to login page

links from UM list of users have slash and redirect to user profile as it should be

 

How to modify this code to make it works properly?

function my_link($link, $user) {
  return 'https://mysite.ru/user/'.$user->user_login;
}
add_filter('asgarosforum_filter_profile_link', 'my_link', 10, 2);

 

Hi childledj,

I have updated to UM 2.0.5 and the user profile links still work fine with the code you mentioned.  Here is my rendition which modified the generic my_link to my_prof_link

function my_prof_link($link, $user) {
  return 'http://mysite.com/user/'.$user->user_login;
}
add_filter('asgarosforum_filter_profile_link', 'my_prof_link', 10, 2);
childledj has reacted to this post.
childledj

I have use another solution:

function my_link($link, $user) {
  return 'https://www.mysite.ru/user/'.$user->user_login."/";
}
add_filter('asgarosforum_filter_profile_link', 'my_link', 10, 2);

But “slash” wasn’t my problem, but missing “www” in link!

Asgaros has reacted to this post.
Asgaros

Hey,

If you need to link username on “post-author”, I have one solution.

In forum-profile.php, replace :

public function getProfileLink($userObject) {
    if ($this->hideProfileLink() || !$this->functionalityEnabled()) {
        return '%s';
    } else {
        $profileLink = $this->asgarosforum->getLink('profile', $userObject->ID);
        $profileLink = apply_filters('asgarosforum_filter_profile_link', $profileLink, $userObject);

        return '<a class="profile-link" href="/profil/'.$userdata->user_nicename.'">%s</a>';
    }
}

by this :

public function getProfileLink($userObject) {
   
        $profileLink = $this->asgarosforum->getLink('profile', $userObject->ID);
        $profileLink = apply_filters('asgarosforum_filter_profile_link', $profileLink, $userObject);

        return '<a class="profile-link" href="/profile/'.$userObject->user_nicename.'">%s</a>';
    }

Change “/profile/” by your profile page link.

Hello,

After last update (1.9.0), old solution doesn’t work. Here is the new code :

public function getProfileLink($userObject) {

$profileLink = $this->asgarosforum->get_link('profile', $userObject->ID);
$profileLink = apply_filters('asgarosforum_filter_profile_link', $profileLink, $userObject);

return '<a class="profile-link" href="/profil/'.$userObject->user_nicename.'">%s</a>';
}
Asgaros has reacted to this post.
Asgaros

Hello Desben,
I also have problems since the update 1.9. Where did you insert this code?
Originally I had the following code in the functions.php inserted by the theme:

function my_link($link, $user) {
return ‘http://myhakotrac.de/user/’.$user->user_login;
}
add_filter(‘asgarosforum_filter_profile_link’, ‘my_link’, 10, 2);

Unfortunately, I do not know well with codes and would need precise instructions.
Thanks Robert

I’m using 1.9.0 and can confirm that the same filter for the user profile links still works.  Here is the excerpt from my functions.php:

function my_prof_link($link, $user) {
  return '/user/'.$user->user_login;
}
add_filter('asgarosforum_filter_profile_link', 'my_prof_link', 10, 2);

Hello @v490

The official way using the asgarosforum_filter_profile_link should still work fine. Do you get any error? How does the generated link looks like?

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

Thank you for your prompt reply.
The problem has settled after an update by Ultimate Member.
Everything will be displayed again as usual.
Greetings Robert

PreviousPage 2 of 4Next