LLMS_Query_Quiz_Attempt::sql_joins()

SQL “joins” clause for the query.


Return Return

(string)


Top ↑

Source Source

File: includes/class.llms.query.quiz.attempt.php

	protected function sql_joins() {
		global $wpdb;

		$joins = '';

		// Join users table for search functionality
		if ( $this->get( 'search' ) ) {
			$joins .= " LEFT JOIN {$wpdb->users} u ON qa.student_id = u.ID";
			$joins .= " LEFT JOIN {$wpdb->usermeta} um_first ON u.ID = um_first.user_id AND um_first.meta_key = 'first_name'";
			$joins .= " LEFT JOIN {$wpdb->usermeta} um_last ON u.ID = um_last.user_id AND um_last.meta_key = 'last_name'";
			// Add in posts of type llms_quiz for search functionality
			$joins .= " LEFT JOIN {$wpdb->posts} p ON qa.quiz_id = p.ID AND p.post_type = 'llms_quiz'";
		}

		return $joins;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
9.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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