What’s the difference between wp_insert_user() and wp_create_user()

None. The whole source of wp_create_user() is:

function wp_create_user($username, $password, $email="") {
    $user_login = esc_sql( $username );
    $user_email = esc_sql( $email    );
    $user_pass = $password;

    $userdata = compact('user_login', 'user_email', 'user_pass');
    return wp_insert_user($userdata);
}

It just calls insert version almost immediately, basically a shorthand wrapper. As for why it exists – core works in mysterious ways and (short of hunting down developer by version control history and asking) there is rarely way to tell. 🙂

Leave a Comment