WP_User::init( object $data, int $site_id =  )

In this article

Sets up object properties, including capabilities.

Parameters

$dataobjectrequired
User DB row object.
$site_idintoptional
The site ID to initialize for.

Default:''

Source

public function init( $data, $site_id = '' ) {
	if ( ! isset( $data->ID ) ) {
		$data->ID = 0;
	}
	$this->data = $data;
	$this->ID   = (int) $data->ID;

	$this->for_site( $site_id );
}

Changelog

VersionDescription
3.3.0Introduced.

User Contributed Notes

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