bbp_get_form_topic_tags ()

返回主题标记字段的值

描述

返回

(字符串)主题标签字段的值

文件:bp-forums /主题/ template.php

function bbp_get_form_topic_tags(){//获取数据if (bbp_is_post_request() && isset($_POST['bbp_topic_tags']) {$_POST['bbp_topic_tags']);/ /获取编辑数据}elseif (bbp_is_single_topic () | | bbp_is_single_reply () | | bbp_is_topic_edit () | | bbp_is_reply_edit () ) { // 确定主题基于职位类型开关(get_post_type id () ) { // 文章是一个主题bbp_get_topic_post_type (): $ topic_id = get_the_ID ();打破;bbp_get_reply_post_type(): $topic_id = bbp_get_reply_topic_id(get_the_ID());打破;} $new_terms = array();$new_terms = get_post_meta($topic_id, '_bbp_spam_topic_tags', true);} else {$terms = array_filter((array) get_the_terms($topic_id, bbp_get_topic_tag_tax_id()));$new_terms = wp_list_pluck($terms, 'name');}} //设置返回值$topic_tags = (!empty($new_terms)) ? implode( ', ', $new_terms ) : ''; // No data } else { $topic_tags = ''; } return apply_filters( 'bbp_get_form_topic_tags', esc_attr( $topic_tags ) ); }

更新日志

更新日志
版本 描述
bbPress (r2976) 介绍了。

问题吗?

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