bp_registration_buddypress_allowed_areas

Check if on an allowed BuddyPress component.

Description

(boolean) bp_registration_buddypress_allowed_areas(); 

Returns (boolean)

True if an allowed component, false otherwise.


Usage

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

Defined (1)

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

/includes/core.php  
  1. function bp_registration_buddypress_allowed_areas() { 
  2.  
  3. $allowed = false; 
  4.  
  5. if ( function_exists( 'bp_is_my_profile' ) ) { 
  6. global $bp; 
  7.  
  8. if ( bp_is_my_profile() || bp_is_user_profile() || bp_is_user_profile_edit() || 'register' === $bp->current_component || 'activate' === $bp->current_component ) { 
  9. $allowed = true; 
  10.  
  11. /** 
  12. * Filter for user-set custom areas of BuddyPress. 
  13. * @since 4.3.0 
  14. * @param bool $allowed Current allowed value. 
  15. */ 
  16. return apply_filters( 'bprwg_buddypress_allowed_areas', $allowed );