LLMS_Order_Generator::get_user_data()

Retrieves an array of data representing the student.


Description Description

The resulting array is intended to be used for setting up the LLMS_Order post’s user metadata, ideally passed to LLMS_Order::init().


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-llms-order-generator.php

	public function get_user_data() {

		$map = array(
			'billing_email'      => 'email_address',
			'billing_first_name' => 'first_name',
			'billing_last_name'  => 'last_name',
			'billing_phone'      => 'llms_phone',
		);

		$data = array(
			'billing_email'      => '',
			'billing_first_name' => '',
			'billing_last_name'  => '',
			'billing_address_1'  => '',
			'billing_address_2'  => '',
			'billing_city'       => '',
			'billing_state'      => '',
			'billing_zip'        => '',
			'billing_country'    => '',
			'billing_phone'      => '',
		);

		foreach ( $data as $key => &$val ) {
			$data_key = $map[ $key ] ?? "llms_{$key}";
			$val      = $this->data[ $data_key ] ?? '';
		}

		$data['user_id'] = $this->student ? $this->student->get( 'id' ) : '';

		return $data;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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