Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author wordplus

    (@wordplus)

    what is print_r of get_userdata()?

    Thread Starter musoaga

    (@musoaga)

    My URL looks like this:

    https://mysite.de/mein-konto/messages/?new-message&to=user.name

    The PHP:

    
    $userId = get_post_field('post_author', $postID);
    $user_info = get_userdata($userId);
    $link_to_new_message_screen = get_site_url() . '/mein-konto/messages/' . '?new-message&to=' . $user_info->user_login;
    
    Plugin Author wordplus

    (@wordplus)

    user_nicename is empty?

    Thread Starter musoaga

    (@musoaga)

    No, it prints the right user nicename. Actually the code is not the problem. Even if I type the URL with parameters manually in the browser, the “send to” input is not filled :/

    Plugin Author wordplus

    (@wordplus)

    try to use user_nicename instead of user_login, its important.

    Plugin Author wordplus

    (@wordplus)

    user_nicename can have minor differences, please check carefully if its the same

    Thread Starter musoaga

    (@musoaga)

    Tried with user_nicename, but same problem. I really dont know, whats the problem is. I think I will try to fill the input manually in my PHP file where I show the message page

    Plugin Author wordplus

    (@wordplus)

    please let me know what was the problem. or let me look myself. you can contact directly in plugin menu.

    Plugin Author wordplus

    (@wordplus)

    just tested at my website without buddypress and all worked fine

    Thread Starter musoaga

    (@musoaga)

    I contacted you via plugin menu, but found after that the problem..

    The problem was a “dot” in the user name like: “user.name”

    Dont know if it is a bug, but would be nice, if this also works with dots.

    Plugin Author wordplus

    (@wordplus)

    You should use user_nicename, not user_login or anything else. It replace dots in username.

    Thread Starter musoaga

    (@musoaga)

    Works now with $user_info->user_nicename. Actually tried that yesterday. Anyway… Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Custom Message URL with Username’ is closed to new replies.