Please or Register to create posts and topics.

Profile link with this code

function my_filtered_post_username($username, $userID)
{
if(class_exists(‘PM_request’))
{
$pmrequests = new PM_request;
$profile_url = $pmrequests->pm_get_user_profile_url($userID);
return ‘‘.$username.’‘;
}
}
add_filter(‘asgarosforum_filter_post_username’, ‘my_filtered_post_username’, 10, 2);

I got this code from the developers of a  profile extension that I use is response to the code posted on the forum to create a link to profile. However there is no actual URL link created how do I do that?

Hello natchoice,

you are using the wrong filter. Please try the following code with activated profile-functionality:

function my_link($link, $user) {
    if(class_exists(‘PM_request’)) {
        $pmrequests = new PM_request;
        $link = $pmrequests->pm_get_user_profile_url($user->ID);
    }

    return $link;
}
add_filter('asgarosforum_filter_profile_link', 'my_link', 10, 2);

 

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