Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Already found it. Changed it in the php files chat en form
    changed the after the last arrow to user_firstname
    $logged_username = $current_user->user_firstname;

    Plugin Author Jeff Starr

    (@specialk)

    Glad you found a solution. I’ll add a filter for this in the next update, so you won’t need to modify any core files, which is not recommended.

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up with this, the next version of the plugin includes a filter hook sac_logged_username that enables modifying of the logged-in username. Thank you for the feedback.

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Super! Thanks

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Oke… not an expert on this area… how does this work?

    Plugin Author Jeff Starr

    (@specialk)

    There are lots of things that can be done via filter hooks, but for your case try adding the following code to your theme’s functions.php file (or via a custom plugin):

    // customize the logged-in username
    function sac_customize_logged_username($logged_username, $current_user) {
    	$logged_username = $current_user->user_firstname;
    	return $logged_username;
    }
    add_filter('sac_logged_username', 'sac_customize_logged_username', 10, 2);

    You can see where the same modification is applied via this function. That way, there is no need to modify the core plugin files, and so the change will remain in place even if the plugin is updated.

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Thanks. Put it in a custom plugin.
    🙂 It does work on the name display. But in the chat the name stays full after posting a message.

    Plugin Author Jeff Starr

    (@specialk)

    Ah well will have to look at it again and try to get another update out with more hooks. Should be available sometime tomorrow depending on workload.

    Plugin Author Jeff Starr

    (@specialk)

    Hey got this fixed up with version 20171103. Should be good to go using that previous snippet, works for all logged username instances.

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Works perfectly 🙂 Thanks a lot!

    Plugin Author Jeff Starr

    (@specialk)

    You are very welcome! 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘change full name to first name’ is closed to new replies.