• How can I have the install process of WordPress add an extra field to wp_user? (I have not installed WordPress yet and don’t want to use MyAdmin to add a field to MySQL)

    What file creates the MySQL fields.

Viewing 4 replies - 1 through 4 (of 4 total)
  • take a look at wp-includes/upgrade-functions.php

    Thread Starter dcole07

    (@dcole07)

    // Create default user.  If the user already exists, the user tables are
    	// being shared among blogs.  Just set the role in that case.
    	$user_id = username_exists($user_name);
    	if ( !$user_id ) {
    		$random_password = substr(md5(uniqid(microtime())), 0, 6);
    		$user_id = wp_create_user($user_name, $random_password, $user_email);
    	} else {
    		$random_password = __('User already exists.  Password inherited.');
    	}
    
    	$user = new WP_User($user_id);
    	$user->set_role('administrator');
    
    	wp_install_defaults($user_id);
    
    	$wp_rewrite->flush_rules();
    
    	wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);
    
    	wp_cache_flush();
    
    	return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password);
    }
    endif;

    Was it wp-admin/upgrade-function.php, if so. Here I can see that we are creating the first user…
    So the fields are setup with the first account?
    Should I just add to return array at the bottom of this part I cut out? be like , ‘counter’ => ‘0’;

    yes it was wp-admin/ …

    Thread Starter dcole07

    (@dcole07)

    would adding ‘counter’ => ‘0’; to the return array add another field?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘extra wp_user at installation’ is closed to new replies.