Support » Plugin: Force First and Last Name as Display Name » force old and new users display name to nickname

  • Resolved Hari

    (@haribonda)


    thanks for an a awsome plugin, i want to force change old and new user’s display name to nickname or just the first name could you add this feature or tell me a way to manually change the code

    thanks in advance

    • This topic was modified 4 months, 3 weeks ago by Hari.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Kim Coleman

    (@kimannwall)

    Hi @haribonda ,

    Here’s the code for just first name: https://gist.github.com/kimcoleman/613b90e6ff2b092318eed48c5b6c04bf

    Once that’s code is in place whether through a custom plugin or the Code Snippets plugin, you can run the script on the Force First Last admin settings page under “General”.

    Thread Starter Hari

    (@haribonda)

    Thanks a lot, this really made my day! 💐

    
    <?php
    /*
     * Change the display name to default to just the first name using the Force First Last WordPress plugin.
     * https://wordpress.org/plugins/force-first-last/
     *
     * You can add this recipe to your site by creating a custom plugin
     * or using the Code Snippets plugin available for free in the WordPress repository.
     */
    function my_ffl_display_name_just_first( $display_name_order, $first_name, $last_name ) {
    	$display_name_order = array( $first_name ,'' );
    	return $display_name_order;
    }
    add_filter( 'ffl_display_name_order', 'my_ffl_display_name_just_first', 15, 3 );
    • This reply was modified 2 months, 3 weeks ago by Hari.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.