BP_Core_User::__construct( integer $user_id, bool $populate_extras = false )

Class constructor.

Description

Parameters

$user_id

(integer) (Required) The ID for the user being queried.

$populate_extras

(bool) (Optional) Whether to fetch extra information such as group/friendship counts or not. Default: false.

Default value: false

Source

File: bp-core/classes/class-bp-core-user.php

	public function __construct( $user_id, $populate_extras = false ) {
		if ( !empty( $user_id ) ) {
			$this->id = $user_id;
			$this->populate();

			if ( !empty( $populate_extras ) ) {
				$this->populate_extras();
			}
		}
	}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.