invalid foreach

Used this multicheck callback to output terms and got this error when no categories were present