Error thrown

Cannot use object of type WP_Term as array