yeahhub

Wordpress Display Name Change

Jun 16th, 2018
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  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');
Add Comment
Please, Sign In to add comment