BP_XProfile_Field::__construct( int|null $id = null, int|null $user_id = null, bool $get_data = true )

Initialize and/or populate profile field.


Description Description


Parameters Parameters

$id

(Optional) Field ID.

Default value: null

$user_id

(Optional) User ID.

Default value: null

$get_data

(Optional) Get data.

Default value: true


Top ↑

Source Source

File: bp-xprofile/classes/class-bp-xprofile-field.php

	public function __construct( $id = null, $user_id = null, $get_data = true ) {

		if ( ! empty( $id ) ) {
			$this->populate( $id, $user_id, $get_data );

		// Initialise the type obj to prevent fatals when creating new profile fields.
		} else {
			$this->type_obj            = bp_xprofile_create_field_type( 'textbox' );
			$this->type_obj->field_obj = $this;
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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