Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ismail

    (@elhardoum)

    Hi!

    I looked it online how to get the dynamic profile of a given user, I think there’s um_user_profile_url() but not sure if it takes the user ID to be passed as the first param. Try this:

    add_filter("wpc_get_user_links", function($links, $user_id) {
        if ( function_exists('um_user_profile_url') && !empty( $links->profile ) ) {
            $links->profile = um_user_profile_url($user_id);
        }
        return $links;
    }, 10, 2);

    Let me know how it goes.

    Thanks.
    Samuel

    Thread Starter meale

    (@meale)

    Hi Samuel, thanks for your answer!
    I’m sorry to tell you that this filter doesn’t work at all.
    When I click in a profile I am redirected to UM profile but not at the correct profile.
    I am trying this with 3 profile from the WpChat Members page and these are the redirections:
    Profile 1 -> Profile 1
    Profile 2 -> Profile 1
    Profile 3 -> Profile 2
    However when I reload the WpChats members page this combination change.. ex. The same “Profile 1” will be redirected to a “Profile 3”. There isn’t an order but at random.
    I found this in the ultimate member official site, i don’t know if is helpful:
    https://docs.ultimatemember.com/article/34-get-the-current-user-profile-id

    Thanks

    Plugin Author Ismail

    (@elhardoum)

    Hello,

    okay so that confirms my thoughts about that func.

    Can you tell me the structure of user profile? example example.com/user/user-nicename-here if so then that would be

    $links->profile = home_url( sprintf( "user/%s/", get_userdata($user_id)->user_nicename ) );

    Regards,
    Samuel

    Thread Starter meale

    (@meale)

    Hello Samuel,
    thanks for you help! This function works perfectly!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I Filter WpChats profile to Ultimate Member profile?’ is closed to new replies.