public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Get a list of tags for the specified list of question IDs.
 *
 * @since 1.0.0
 *
 * @param array $questionList The list of question IDs to get tags for.
 *
 * @return array The list of tags for this question.
 */
Get a list of tags for the specified list of question IDs.

@param array $questionList The list of question IDs to get tags for.

@return array The list of tags for this question.
Get a list of tags for the specified list of question IDs . @param array $questionList The list of question IDs to get tags for . @return array The list of tags for this question .
function WPCW_questions_tags_getTagsForQuestionList( $questionList ) {
	if ( empty( $questionList ) ) {
		return false;
	}
	global $wpcwdb, $wpdb;
	$wpdb->show_errors();
	$numberOfIDs = count( $questionList );
	$sqlForIDs   = rtrim( str_repeat( '%d,', $numberOfIDs ), ',' );
	return $wpdb->get_results( $wpdb->prepare( "
		SELECT qtm.question_id, qt.*
		FROM $wpcwdb->question_tag_mapping qtm
			LEFT JOIN $wpcwdb->question_tags qt ON qtm.tag_id = qt.question_tag_id
		WHERE question_id IN ($sqlForIDs)
		  AND question_tag_name IS NOT NULL
		ORDER BY question_id ASC
	", $questionList ) );
}
function WPCW_questions_tags_getTagsForQuestionList ( $ questionList ) { if ( empty ( $ questionList ) ) { return false ; } global $ wpcwdb , $ wpdb ; $ wpdb -> show_errors ( ) ; $ numberOfIDs = count ( $ questionList ) ; $ sqlForIDs = rtrim ( str_repeat ( '%d,' , $ numberOfIDs ) , ',' ) ; return $ wpdb -> get_results ( $ wpdb -> prepare ( " 
		SELECT qtm.question_id, qt.*
		FROM  $ wpcwdb -> question_tag_mapping  qtm
			LEFT JOIN  $ wpcwdb -> question_tags  qt ON qtm.tag_id = qt.question_tag_id
		WHERE question_id IN ( $ sqlForIDs )
		  AND question_tag_name IS NOT NULL
		ORDER BY question_id ASC
	 " , $ questionList ) ) ; }
Get a list of tags for the specified list of question IDs.
Get a list of tags for the specified list of question IDs .
// Generate the right number of %d in the SQL, removing final comma.