LLMS_Privacy_Erasers::order_data( string $email_address, int $page )

Erase student order data by email address


Parameters Parameters

$email_address

(string) (Required) email address of the user to retrieve data for

$page

(int) (Required) process page number


Top ↑

Return Return

(array)


Top ↑

Source Source

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

	public static function order_data( $email_address, $page ) {

		$ret = self::get_return();

		$student = parent::get_student_by_email( $email_address );
		if ( ! $student ) {
			return $ret;
		}

		$enabled = llms_parse_bool( get_option( 'llms_erasure_request_removes_order_data', 'no' ) );
		$orders  = self::get_student_orders( $student, $page );

		foreach ( $orders['orders'] as $order ) {

			if ( apply_filters( 'llms_privacy_erase_order_data', $enabled, $order ) ) {

				self::erase_order_data( $order );

				/* Translators: %d Order number. */
				$ret['messages'][]    = sprintf( __( 'Removed personal data from order #%d.', 'lifterlms' ), $order->get( 'id' ) );
				$ret['items_removed'] = true;

			} else {

				/* Translators: %d Order number. */
				$ret['messages'][]     = sprintf( __( 'Personal data within order #%d has been retained.', 'lifterlms' ), $order->get( 'id' ) );
				$ret['items_retained'] = true;

			}
		}

		$ret['done'] = isset( $orders['done'] ) ? $orders['done'] : true;

		return $ret;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.18.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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