Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Student::insert_enrollment_postmeta( int $product_id, string $trigger = 'unspecified' )

Add student postmeta data for enrollment into a course or membership


Parameters Parameters

$product_id

(int) (Required) WP Post ID of the course or membership

$trigger

(string) (Optional) String describing the reason for enrollment

Default value: 'unspecified'


Top ↑

Return Return

(boolean)


Top ↑

Source Source

File: includes/models/model.llms.student.php

	private function insert_enrollment_postmeta( $product_id, $trigger = 'unspecified' ) {

		// Add info to the user postmeta table.
		$user_metadatas = array(
			'_enrollment_trigger' => $trigger,
			'_start_date'         => 'yes',
			'_status'             => 'enrolled',
		);

		$update = llms_bulk_update_user_postmeta( $this->get_id(), $product_id, $user_metadatas, false );

		// Returns an array with errored keys or true on success.
		return is_array( $update ) ? false : true;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.2.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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