WP_User::init() WordPress Method
The WP_User::init() method is used to initialize a new WP_User object. This method is called when a new user is created.
WP_User::init( object $data, int $site_id = '' ) #
Sets up object properties, including capabilities.
Parameters
- $data
(object)(Required)User DB row object.
- $site_id
(int)(Optional) The site ID to initialize for.
Default value: ''
Source
File: wp-includes/class-wp-user.php
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 ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |