public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Action called when a user is deleted in WordPress. Remove all progress
 * and certificate details.
 *
 * @since 1.0.0
 *
 * @param integer $user_id The ID of the user that's just been deleted.
 */
Action called when a user is deleted in WordPress. Remove all progress
and certificate details.



@param integer $user_id The ID of the user that's just been deleted.
Action called when a user is deleted in WordPress . Remove all progress and certificate details . @param integer $user_id The ID of the user that ' s just been deleted .
function WPCW_actions_users_userDeleted( $user_id ) {
	global $wpdb, $wpcwdb;
	$wpdb->show_errors();
	$wpdb->query( $SQL = $wpdb->prepare( "
				DELETE FROM $wpcwdb->user_courses
				WHERE user_id = %d
			", $user_id ) );
	$wpdb->query( $SQL = $wpdb->prepare( "
				DELETE FROM $wpcwdb->user_progress
				WHERE user_id = %d
			", $user_id ) );
	$wpdb->query( $SQL = $wpdb->prepare( "
				DELETE FROM $wpcwdb->user_progress_quiz
				WHERE user_id = %d
			", $user_id ) );
	$wpdb->query( $SQL = $wpdb->prepare( "
				DELETE FROM $wpcwdb->question_rand_lock
				WHERE question_user_id = %d
			", $user_id ) );
	$wpdb->query( $SQL = $wpdb->prepare( "
				DELETE FROM $wpcwdb->queue_dripfeed
				WHERE queue_user_id = %d
			", $user_id ) );
	$wpdb->query( $SQL = $wpdb->prepare( "
				DELETE FROM $wpcwdb->certificates
				WHERE cert_user_id = %d
			", $user_id ) );
}
function WPCW_actions_users_userDeleted ( $ user_id ) { global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ wpdb -> query ( $ SQL = $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> user_courses 
				WHERE user_id = %d
			 " , $ user_id ) ) ; $ wpdb -> query ( $ SQL = $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> user_progress 
				WHERE user_id = %d
			 " , $ user_id ) ) ; $ wpdb -> query ( $ SQL = $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> user_progress_quiz 
				WHERE user_id = %d
			 " , $ user_id ) ) ; $ wpdb -> query ( $ SQL = $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> question_rand_lock 
				WHERE question_user_id = %d
			 " , $ user_id ) ) ; $ wpdb -> query ( $ SQL = $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> queue_dripfeed 
				WHERE queue_user_id = %d
			 " , $ user_id ) ) ; $ wpdb -> query ( $ SQL = $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> certificates 
				WHERE cert_user_id = %d
			 " , $ user_id ) ) ; }
Action called when a user is deleted in WordPress.
Action called when a user is deleted in WordPress .
// Course progress summary for user needs to be removed. // User's progress // User's quiz answers // User's question locks // User's queue entries // User's certificates