bbp_get_blog_roles

Get the available roles minus bbPress's dynamic roles.

Description

(array) bbp_get_blog_roles(); 

Returns (array)


Usage

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

Defined (1)

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

/includes/core/capabilities.php  
  1. function bbp_get_blog_roles() { 
  2.  
  3. // Get WordPress's roles (returns $wp_roles global) 
  4. $wp_roles = bbp_get_wp_roles(); 
  5.  
  6. // Apply the WordPress 'editable_roles' filter to let plugins ride along. 
  7. // 
  8. // We use this internally via bbp_filter_blog_editable_roles() to remove 
  9. // any custom bbPress roles that are added to the global. 
  10. $the_roles = isset( $wp_roles->roles ) ? $wp_roles->roles : false; 
  11. $all_roles = apply_filters( 'editable_roles', $the_roles ); 
  12.  
  13. return apply_filters( 'bbp_get_blog_roles', $all_roles, $wp_roles );