SHARE
TWEET

Wordpress Display Name Change

yeahhub Jun 16th, 2018 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Change Default Display Name (Powered by yeahhub.com)
  3.  */
  4.  
  5. function change_display_name( $user_id ) {
  6.  $info = get_userdata( $user_id );
  7.  $args = array(
  8.  'ID' => $user_id,
  9.  'display_name' => $info->first_name . ' ' . $info->last_name
  10.  );
  11.  wp_update_user( $args );
  12. }
  13. add_action('user_register','change_display_name');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top