bp_get_member_types (|字符串数组args美元数组()字符串输出美元“名字”字符串美元符”和“

获取所有已注册概要文件类型对象的列表。

描述

另请参阅

参数

args美元

数组|字符串(可选)一个key =>值参数数组,用于匹配配置文件类型对象。

默认值:数组()

输出美元

字符串(可选)要返回的输出类型。接受“名称”或“对象”。

默认值:“名字”

美元符

字符串(可选)要执行的逻辑操作。'or'表示只需要匹配数组中的一个元素;'and'表示所有元素必须匹配。接受'or'或'and'。

默认值:”和“

返回

(数组)配置文件类型名称或对象的列表。

文件:bp-members / bp-members-functions.php

函数bp_get_member_types($args = array(), $output = 'names', $operator = 'and') {$types = buddypress()->成员->类型;$types = wp_filter_object_list($types, $args, $operator);/** *过滤配置文件类型对象数组。* *该过滤器在应用$output过滤器之前运行,以便*过滤函数可以访问整个概要文件类型对象。* * @since BuddyPress 2.2.0 * * @param array $types profile type objects, key by name。* @param array $args数组的关键字=>值参数过滤。* @param string $operator '或'匹配任何$args, '和'要求所有。*/ $types = apply_filters('bp_get_member_types', $types, $args, $operator);If ('names' === $output) {$types = wp_list_pluck($types, 'name');美元}返回类型; }

更新日志

更新日志
版本 描述
BuddyPress 2.2.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队