Fixes for ACF compatibility

since some versions of ACF add spaces to strings returned from functions
and used directly in place of a string without first assigning it to a
variable, I've assigned them to variables