Correct the item row class functions changed in recent commits due to the wrong ordering of the sanitize_html_class() function.

sanitize_html_class() removes whitespace, so we need to run it on each
part of the class(es) prior to joining them together.