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

Erase student postmeta 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

([type])


Top ↑

Source Source

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

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

		$ret = self::get_return();

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

		$messages = array();
		$enabled  = llms_parse_bool( get_option( 'llms_erasure_request_removes_lms_data', 'no' ) );

		if ( apply_filters( 'llms_privacy_erase_postmeta_data', $enabled, $attempt ) ) {

			global $wpdb;
			$deleted = $wpdb->query(
				$wpdb->prepare(
					"DELETE FROM {$wpdb->prefix}lifterlms_user_postmeta WHERE user_id = %d",
					$student->get( 'id' )
				)
			);

			$ret['messages'][]    = __( 'Removed all student course and membership enrollment and activity data.', 'lifterlms' );
			$ret['items_removed'] = true;

		} else {

			$ret['messages'][]     = __( 'Retained all student course and membership enrollment and activity data.', 'lifterlms' );
			$ret['items_retained'] = 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.