public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Given a list of tags, try to add them to the specified question.
 *
 * @since 1.0.0
 *
 * @param integer $questionID The ID of the question that we're adding the tag for.
 * @param array   $tagList The list of tags to add.
 *
 * @return array The list of tags to be rendered again.
 */
Given a list of tags, try to add them to the specified question.

@param integer $questionID The ID of the question that we're adding the tag for.
@param array   $tagList The list of tags to add.

@return array The list of tags to be rendered again.
Given a list of tags try to add them to the specified question . @param integer $questionID The ID of the question that we ' re adding the tag for . @param array $tagList The list of tags to add . @return array The list of tags to be rendered again .
function WPCW_questions_tags_addTags( $questionID, $tagList ) {
	if ( empty( $tagList ) ) {
		return;
	}
	global $wpdb, $wpcwdb;
	$wpdb->show_errors();
	$taglistToReturn = WPCW_questions_tags_addTags_withoutQuestion( $tagList );
	foreach ( $taglistToReturn as $tagID => $tagText ) {
		$wpdb->query( $wpdb->prepare( "
			INSERT IGNORE INTO $wpcwdb->question_tag_mapping
			(question_id, tag_id)
			VALUES (%d, %d)
		", $questionID, $tagID ) );
		WPCW_questions_tags_updatePopularity( $tagID );
	}
	return $taglistToReturn;
}
function WPCW_questions_tags_addTags ( $ questionID , $ tagList ) { if ( empty ( $ tagList ) ) { return ; } global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ taglistToReturn = WPCW_questions_tags_addTags_withoutQuestion ( $ tagList ) ; foreach ( $ taglistToReturn as $ tagID => $ tagText ) { $ wpdb -> query ( $ wpdb -> prepare ( " 
			INSERT IGNORE INTO  $ wpcwdb -> question_tag_mapping 
			(question_id, tag_id)
			VALUES (%d, %d)
		 " , $ questionID , $ tagID ) ) ; WPCW_questions_tags_updatePopularity ( $ tagID ) ; } return $ taglistToReturn ; }
Given a list of tags, try to add them to the specified question.
Given a list of tags try to add them to the specified question .
// Now we need to work through and associate each tag with the question