• Resolved edwardnewsky

    (@edwardnewsky)


    Hello, great plugin, lightweight and fast, great job!

    I have a problem:
    I need to make a link to the telegram user chat

    1) if the user is not registered:
    start register user process…
    the plugin fills in the fields in the database:
    wp_user – user_login, user_nicename …
    and
    wp_usermeta – wptelegram_user_id
    no problem, i do:
    echo '<a href="t.me/'. get_the_author_meta('user_nicename', $current_author-> ID).' ">
    link done.

    2) if the user is authorized and attaches his telegram profile to his account:
    the plugin fills in the fields in the database:
    wp_usermeta – wptelegram_user_id
    plugin does not add telegram username because wp_user – user_login, user_nicename … are already exist
    it is impossible to make a link to the telegram user by id

    Maybe you can duplicate the username parameter obtained from the telegram, for example in:
    wp_user – user_url
    or create a new graph in the database?

    • This topic was modified 4 years, 3 months ago by edwardnewsky.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,
    Yes, I understand your problem and it’s an interesting use case.
    Currently the plugin doesn’t store anything else than ID for an existing user. I will try to also store Telegram username in user meta in the upcoming updates.

    Thank you

    Hello,
    An update has been released to the plugin to add that feature. You can now use this:

    get_the_author_meta( WPTELEGRAM_USERNAME_META_KEY, $current_author->ID )

    Make sure to update the plugin before using that code.

    Note: The code will work for the users who login using Telegram after the latest update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Link to user do not work’ is closed to new replies.