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::delete_enrollment_postmeta( int $product_id, string $trigger = null )

Remove student enrollment postmeta for a given product.

Parameters Parameters


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


(string) (Optional) String the reason for enrollment. Default null

Default value: null

Top ↑

Return Return

(boolean) Whether or not the enrollment records have been succesfully removed.

Top ↑

Source Source

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

	private function delete_enrollment_postmeta( $product_id, $trigger = null ) {

		// Delete info from the user postmeta table.
		$user_metadatas = array(
			'_enrollment_trigger' => $trigger,
			'_start_date'         => null,
			'_status'             => null,

		$delete = llms_bulk_delete_user_postmeta( $this->get_id(), $product_id, $user_metadatas );

		return is_array( $delete ) ? false : true;

Top ↑

Changelog Changelog

Version Description
3.33.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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