Error thrown

Cannot use object of type WP_Error as array