Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wordpress中get_terms()的筛选结果_Wordpress_Filtering_Taxonomy - Fatal编程技术网

wordpress中get_terms()的筛选结果

wordpress中get_terms()的筛选结果,wordpress,filtering,taxonomy,Wordpress,Filtering,Taxonomy,我正在显示一个教员列表,其中包含一个名为“教员”的自定义分类法中的一些自定义字段信息。每个学期的名称都是教员的全名,因此当我使用get_terms()按姓名排序时,我会得到一个基于名字的字母列表。我知道我可以过滤获取_terms()。但我不知道是否有任何方法可以过滤返回的对象数组,以便它从name字段中提取姓氏并按这种方式排序?一如既往,我们将非常感谢您的帮助 作为参考,这是前两个返回对象的外观 Array ( [0] => stdClass Object ( [term_id] =>

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

作为参考,这是前两个返回对象的外观

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 )

你能把你返回的对象粘贴到这里吗?嗨@wordpresser,我已经在我的帖子中添加了一个示例。谢谢你不能通过标准的wordpress函数来完成它,因为
last\u name
不是要排序的列/字段。谢谢@wordpresser,我很担心。如果他们为了排序而添加姓氏自定义字段,我将如何锁定该字段来执行排序?好的,所以我快速搜索了一下,发现这个链接很有用。。