Show just first name with last initial?

Is there a way to just have the first name and last name initial instead of full name?

Answers

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited August 2016
    You can add the following code to the end of the functions.php file of your WordPress them

    function oa_social_login_change_new_user_fields ($user_fields) { if ( ! empty ($user_fields['first_name'])) { $user_fields['first_name'] = substr ($user_fields['first_name'], 0, 1); } if ( ! empty ($user_fields['last_name'])) { $user_fields['last_name'] = substr ($user_fields['last_name'], 0, 1); } return $user_fields; } add_filter('oa_social_login_filter_new_user_fields', 'oa_social_login_change_new_user_fields');

    This will replace the first/lastname by their first letters only.

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.