bbp_edit_user_blog_role

Output blog role selector (for user edit).

Description

bbp_edit_user_blog_role(); 

Usage

  1. if ( !function_exists( 'bbp_edit_user_blog_role' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/users/template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_edit_user_blog_role(); 
  7.  

Defined (1)

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

/includes/users/template.php  
  1. function bbp_edit_user_blog_role() { 
  2.  
  3. // Return if no user is being edited 
  4. return; 
  5.  
  6. // Get users current blog role 
  7.  
  8. // Get the blog roles 
  9. $blog_roles = bbp_get_blog_roles(); ?> 
  10.  
  11. <select name="role" id="role"> 
  12. <option value=""><?php esc_html_e( '— No role for this site —', bbpress ); ?></option> 
  13.  
  14. <?php foreach ( $blog_roles as $role => $details ) : ?> 
  15.  
  16. <option <?php selected( $user_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option> 
  17.  
  18. <?php endforeach; ?> 
  19.  
  20. </select> 
  21.  
  22. <?php