wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_create_user › WordPress Function

Od2.0.0
Przestarzałyn/a
wp_create_user ( $username, $password, $email = '' )
Parametry: (3)
  • (string) $username The user's username.
    Wymagane: Tak
  • (string) $password The user's password.
    Wymagane: Tak
  • (string) $email Optional. The user's email. Default empty.
    Wymagane: Nie
    Domyślny: (puste)
Zobacz:
Powrót:
  • (int|WP_Error) The newly created user's ID or a WP_Error object if the user could not be created.
Zdefiniowane na:
Codex:

Provides a simpler way of inserting a user into the database.

Creates a new user with just the username, password, and email. For more complex user creation use wp_insert_user() to specify more information.


Źródło

function wp_create_user( $username, $password, $email = '' ) {
	$user_login = wp_slash( $username );
	$user_email = wp_slash( $email );
	$user_pass  = $password;

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