BP_REST_Topics_Endpoint:: get_topic_tags (inttopic_id美元

主题标签。

描述

参数

topic_id美元

int(必需)主题ID。

返回

(混合|空白)

文件:bp-forums /类/ class-bp-rest-topics-endpoint.php

Public function get_topic_tags($topic_id) {if (empty($topic_id)) {return;} //主题被垃圾邮件,显示垃圾邮件前的术语。if (bbp_is_topic_spam($topic_id)){//获取pre-spam术语。$new_terms = get_post_meta($topic_id, '_bbp_spam_topic_tags', true); / /用户名//如果存在terms,分解它们并编译返回值。If (empty($new_terms)) {$new_terms = ";} //主题不是垃圾邮件,所以要获取真实的术语。} else {$terms = array_filter((array) get_the_terms($topic_id, bbp_get_topic_tag_tax_id()));//循环它们。Foreach ($terms as $term) {$new_terms[] = $term->name; } } // Set the return value. $topic_tags = ( ! empty( $new_terms ) ) ? implode( ', ', $new_terms ) : ''; return apply_filters( 'bbp_get_form_topic_tags', esc_attr( $topic_tags ) ); }

问题吗?

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