예제 #1
0
/**
 * Get the users who have subscribed to the topic
 *
 * @since 2.0.0 bbPress (r2668)
 *
 * @param int $topic_id Optional. Topic id
 * @uses bbp_get_user_terms_by_object() To get the topic subscribers
 * @uses apply_filters() Calls 'bbp_get_topic_subscribers' with the subscribers
 * @return array|bool Results if the topic has any subscribers, otherwise false
 */
function bbp_get_topic_subscribers($topic_id = 0)
{
    $topic_id = bbp_get_topic_id($topic_id);
    $users = bbp_get_users_for_object($topic_id, '_bbp_subscription');
    return (array) apply_filters('bbp_get_topic_subscribers', $users, $topic_id);
}
예제 #2
0
/**
 * Get user IDs of moderators for an object
 *
 * @since 2.6.0 bbPress
 *
 * @param int $object_id
 *
 * @return mixed
 */
function bbp_get_moderator_ids($object_id = 0)
{
    return bbp_get_users_for_object($object_id, '_bbp_moderator_id');
}