bbp_add_caps

Adds capabilities to WordPress user roles.

Description

bbp_add_caps(); 

Usage

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

Defined (1)

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

/includes/core/capabilities.php  
  1. function bbp_add_caps() { 
  2.  
  3. // Loop through available roles and add caps 
  4. foreach ( bbp_get_wp_roles()->role_objects as $role ) { 
  5. foreach ( bbp_get_caps_for_role( $role->name ) as $cap => $value ) { 
  6. $role->add_cap( $cap, $value ); 
  7.  
  8. do_action( 'bbp_add_caps' );