bbp_get_topic_favoriters (inttopic_id美元)
让用户喜欢这个话题
描述
参数
- topic_id美元
-
(int)(可选)主题id
返回
(数组| bool)结果,如果主题有任何偏爱者,否则为假
源
函数bbp_get_topic_favorites ($topic_id = 0) {$topic_id = bbp_get_topic_id($topic_id);If(空($topic_id))返回;全球wpdb美元;$key = $wpdb->前缀。“_bbp_favorites”;$users = wp_cache_get('bbp_get_topic_favoriters_')。美元topic_id bbpress_users);if (false === $users) {$ users = $wpdb->get_col("SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$topic_id}', meta_value) > 0");wp_cache_set(“bbp_get_topic_favoriters_”。$topic_id, $users, 'bbpress_users'); } return apply_filters( 'bbp_get_topic_favoriters', $users ); }
更新日志
版本 | 描述 |
---|---|
bbPress (r2658) | 介绍了。 |