llms_register_user( array $data = array(), string $screen = 'registration', bool $signon = true, array $args = array() )

Register a new user

Parameters Parameters


(array) (Optional) Array of registration data.

Default value: array()


(string) (Optional) The screen to be used for the validation template, accepts "registration" or "checkout"

Default value: 'registration'


(bool) (Optional) If true, signon the newly created user

Default value: true


(array) (Optional) Additional arguments passed to the short-circuit filter.

Default value: array()

Top ↑

Return Return


Top ↑

Source Source

File: includes/functions/llms.functions.person.php

function llms_register_user( $data = array(), $screen = 'registration', $signon = true, $args = array() ) {

	$user_id = LLMS_Form_Handler::instance()->submit( $data, $screen, $args );

	if ( is_wp_error( $user_id ) ) {
		return $user_id;

	// Signon.
	if ( $signon && ! empty( $data['password'] ) ) {

		$user = get_user_by( 'ID', $user_id );

		 * Filters whether or not a new user should be "remembered" when signing on during account creation
		 * @since 5.0.0
		 * @param boolean $remember If `true` (default), the user signon will be set to "remember".
		 * @param string  $screen   Current validation template, either "registration" or "checkout".
		 * @param WP_User $user     User object for the newly registered user.
		$remember = apply_filters( 'llms_user_registration_remember', true, $screen, $user );

				'user_login'    => $user->user_login,
				'user_password' => $data['password'],
				'remember'      => $remember,


	return $user_id;


Top ↑

Changelog Changelog

Version Description
5.0.0 Use LLMS_Form_Handler() for registration.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.