Remove the use of trim to remove final delimiter. We are removing and then adding it again anyway. #6840
Let's just extend what get_category_parents() is giving us.