Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Username ( user_login ) empty on registration/subscription #348953
    Francesca
    Participant

    Hello Michael,
    I can unserstand your point about sensitive data, although I don’t think It’ll go beyond “FrancescaUrbinati80” or something like that. Also, It won’t be the default, only a fallback in case the the form is minimal (aka username and email).

    Please, could you give me more details about the newsletter_subscription hook?
    Is there a chapter in the docs? (I couldn’t find it, sorry)

    Thank you!

    Francesca

    in reply to: Username ( user_login ) empty on registration/subscription #348747
    Francesca
    Participant

    Hello Michael, great news + bugfix!
    I inspected the WP Users addon code and found the culprint:

    index.php in line 34
    plugin.php in line 351

    THE PROBLEM:
    The code assumes that the frontend form provides “first name” and “last name” fields, and that the user filled them in. Therefore, on basic forms with only username (user_login) and email, the code returns no WordPress “name” data for the plugin.

    THE SOLUTION:
    I added 2 fallbacks as follows:

    on index.php
    if($wp_user->first_name == ”) { $newsletter->sanitize_name(strval($wp_user->user_login)); }

    on plugin.php
    if (get_user_meta($wp_user_id, ‘first_name’, true) == ”) { $subscription->data->name = $wp_user->user_login; }

    Yes, they’re rough, but they do the job. 🙂
    I hope this is helpful, and I prey that your developers implement such fallbacks in the next update.
    Thankyou!

    Francesca

    in reply to: Username ( user_login ) empty on registration/subscription #348695
    Francesca
    Participant

    Update:
    I checked the “username” form field:

    * on the WP core login/registration -> user_login
    * on the User Registration plugin -> user_login

    However, the Newsletter plugin doesn’t recognize it, and shows a blank cell under the “name” column on the “All subcribers” page.
    I also tried with “nickname” and “first_name” with no luck.

    Michael, could you please tell me the default fieldname for the username in the Newsletter plugin?
    So I can test further. 🙂

    Many thanks,
    Francesca

    in reply to: Username ( user_login ) empty on registration/subscription #348679
    Francesca
    Participant

    Many thanks Michael!
    I’ll look into it too, and let you know about it. 🙂

Viewing 4 posts - 1 through 4 (of 4 total)