bpbbpst_checklist_moderators

Displays a list of checkbox for moderators notifications.

Description

(string) bpbbpst_checklist_moderators( (bool) $forum_id = false ); 

Admin can choose the moderators that will receive a notification in case a new support topic has been posted.

Returns (string)

html the list of checkboxes

Parameters (1)

0. $forum_id — Optional. (bool) => false
The forum id.

Usage

  1. if ( !function_exists( 'bpbbpst_checklist_moderators' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddy-bbpress-support-topic/includes/functions.php'; 
  3.  
  4. // The forum id. 
  5. $forum_id = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bpbbpst_checklist_moderators($forum_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/functions.php  
  1. function bpbbpst_checklist_moderators( $forum_id = false ) { 
  2.  
  3. $user_query = get_users( array( 'who' => 'bpbbpst_moderators' ) ); 
  4.  
  5. if ( ! is_array( $user_query ) || count( $user_query ) < 1 ) { 
  6. return false; 
  7.  
  8. $recipients = bpbbpst_list_recipients( $forum_id ); 
  9. ?> 
  10. <ul class="bbp-moderators-list"> 
  11. <?php foreach ( $user_query as $user ) :?> 
  12. <li> 
  13. <input type="checkbox" value="<?php echo $user->data->ID;?>" name="_bpbbpst_support_recipients[]" <?php bpbbpst_array_checked( $recipients, $user->data->ID );?>> 
  14. <?php echo $user->data->display_name ;?> (<?php echo bbp_get_dynamic_role_name( bbp_get_user_role( $user->data->ID ) );?>) 
  15. </li> 
  16. <?php endforeach;?> 
  17. </ul> 
  18. <?php