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_Privacy_Exporters::enrollment_data( string $email_address, int $page, string $post_type )

General exporter for handling course and membership enrollment data


Parameters Parameters

$email_address

(string) (Required) Requested user's email address

$page

(int) (Required) process page number

$post_type

(string) (Required) name of the post type


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/privacy/class-llms-privacy-exporters.php

	private static function enrollment_data( $email_address, $page, $post_type ) {

		$data = array();

		$student = self::get_student_by_email( $email_address );
		if ( ! $student ) {
			return self::get_return( $data );
		}

		$enrollments = self::get_student_enrollments( $student, $page, $post_type );
		if ( $enrollments['results'] ) {

			$post_type_obj = get_post_type_object( $post_type );
			$group_id      = 'lifterlms_' . $post_type;

			foreach ( $enrollments['results'] as $post_id ) {

				$data[] = array(
					'group_id'          => $group_id,
					'group_label'       => $post_type_obj->labels->name,
					/* translators: %s: The name of the enrollment post type. */
					'group_description' => sprintf( __( 'Student %s enrollment data.', 'lifterlms' ), $post_type_obj->labels->name ),
					'item_id'           => sprintf( '%1$s-%2$d', $post_type, $post_id ),
					'data'              => self::get_enrollment_data( $post_id, $student, $post_type_obj ),
				);

			}
		}

		return self::get_return( $data, $enrollments['done'] );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.37.9 Added $group_description to the group exporter.
3.18.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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