Error thrown

Object of class WP_Term could not be converted to string