Debugging some custom WordPress code. The foreach() function in PHP does not like empty arrays