0

我正在显示一个教职员工列表,其中包含来自称为“教职员工”的自定义分类法的一些自定义字段信息。每个学期的名字都是教员的全名,所以当我使用 get_terms() 按名字排序时,我会得到一个基于名字的字母顺序列表。我知道我可以过滤 get_terms()。但我不知道是否有任何方法可以过滤返回的对象数组,以便它从名称字段中获取姓氏并以这种方式排序?与往常一样,我们将不胜感激任何帮助。

作为参考,这是前两个返回的对象的样子

Array ( [0] => stdClass Object ( [term_id] => 44 [name] => Abigail McKenzie [slug] => abigail-mckenzie [term_group] => 0 [term_taxonomy_id] => 47 [taxonomy] => faculty-member [description] => Abigail McKenzie has a BFA in painting from the Cleveland Institute of Art, and an MA and MFA in printmaking from the University of Iowa. She is currently the chairman of the Art Department at Flint Hill School in Oakton, Virginia. [parent] => 0 [count] => 1 ) [1] => stdClass Object ( [term_id] => 7 [name] => Amanda Dalla Villa Adams [slug] => amanda-dalla-villa-adams [term_group] => 0 [term_taxonomy_id] => 10 [taxonomy] => faculty-member [description] => Amanda Dalla Villa Adams is a current doctoral student in art history at Virginia Commonwealth University, received her BFA in sculpture from VCU, and her MA in art history from the University of Cincinnati. [parent] => 0 [count] => 3 )
4

0 回答 0