bbp_topic_subscriptions_metabox( $post )
See who is subscribed to a topic
Description Description
Source Source
File: includes/admin/metaboxes.php
function bbp_topic_subscriptions_metabox( $post ) {
// Current user subscription
$input_value = bbp_is_user_subscribed( bbp_get_current_user_id(), $post->ID )
? 'bbp_subscribe' // maintain existing subscription
: ''; // do not add or remove subscription
// Get user IDs
$user_ids = bbp_get_subscribers( $post->ID );
// Output
?>
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="hidden" value="<?php echo esc_attr( $input_value ); ?>" />
<p><?php
// Relationships
$args = array(
'include' => $user_ids
);
// Users were found
if ( ! empty( $user_ids ) && bbp_has_users( $args ) ) :
bbp_metabox_user_links();
// No users
else :
esc_html_e( 'No users have subscribed to this topic.', 'bbpress' );
endif;
?></p><?php
do_action( 'bbp_subscriptions_metabox', $post );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |