bbp_get_wp_roles

Get the $wp_roles global without needing to declare it everywhere.

Description

(WP_Roles) bbp_get_wp_roles(); 

Returns (WP_Roles)


Usage

  1. if ( !function_exists( 'bbp_get_wp_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_wp_roles(); 
  7.  

Defined (1)

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

/includes/core/capabilities.php  
  1. function bbp_get_wp_roles() { 
  2. global $wp_roles; 
  3.  
  4. // Load roles if not set 
  5. if ( ! isset( $wp_roles ) ) 
  6. $wp_roles = new WP_Roles(); 
  7.  
  8. return $wp_roles;