Skip to content

Commit

Permalink
Setting user's nickname and display name to something other than thei…
Browse files Browse the repository at this point in the history
…r email address when they register through bbBolt.
  • Loading branch information
thenbrent committed Nov 29, 2011
1 parent 44be69c commit a6e3aba
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion bbbolt-server.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<?php
/*
* bbBolt Server
*
* This class creates an bbBolt server to manage sign-ups, bbPress publishing and other
* server functions.
*
* Version: beta-1
**/

if( ! class_exists( 'bbBolt_Server' ) ) :

require_once('paypal/paypal-digital-goods.class.php');
require_once( 'paypal/paypal-digital-goods.class.php' );

/**
* The bbBolt Server Work Engine
Expand Down Expand Up @@ -273,6 +281,11 @@ function register_user(){
wp_set_current_user( $user_id );
$user = wp_signon( array( 'user_login' => $user_credentials['email'], 'user_password' => $user_credentials['password'], 'rememberme' => true ) );

// Set the user's nickname and display name to something other than their email address
$display_name = substr( $user_credentials['email'], 0, strpos( $user_credentials['email'], '@') );
wp_update_user( array( 'ID' => $user_id, 'user_nicename' => $display_name, 'display_name' => $display_name ) );
update_user_meta( $user_id, 'nickname', $display_name );

// Notify the site admin & new user
$this->new_user_notifications( $user_id );

Expand Down

0 comments on commit a6e3aba

Please sign in to comment.