Wordpress plugin: How to set default display name?

Discussion in 'Customization & add-ons' started by sharris203, Jan 24, 2010.

  1. sharris203

    sharris203 New Member

    Joined:
    Feb 27, 2009
    Messages:
    45
    The way my site is set, free users enter their first & last name during sign up. If they immediately post a comment, it shows their first and last name.

    Instead of the default display name being first & last name, how can I set it to just their first name? Or even better, show a generic name that I specify (until they actually go in their profile and change it)

    [I have figured out how to do this via a Wordpress plugin but ONLY if they signup through the actual WP registration form, not amember. I need to do it through amember.]
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Change this query in /amember/plugins/protect/wordpress/wordpress.inc.php:
    Code:
    $this->query("INSERT INTO [db]users 
    (user_login, user_email, user_registered, user_pass,
    user_nicename, display_name) 
    VALUES 
    ('$member[login]', '$member[email]', NOW(), '$pass', 
    '$nicename', '$member[name_f] $member[name_l]') 
    ");
    
    for example to:
    Code:
    $this->query("INSERT INTO [db]users 
    (user_login, user_email, user_registered, user_pass,
    user_nicename, display_name) 
    VALUES 
    ('$member[login]', '$member[email]', NOW(), '$pass', 
    '$nicename', '$member[name_f]') 
    ");
    
  3. sharris203

    sharris203 New Member

    Joined:
    Feb 27, 2009
    Messages:
    45
    Worked great!

    I see what's happening. Worked great, thanks!

Share This Page