bp_core_catch_no_access

Catch unauthorized access to certain BuddyPress pages and redirect accordingly.

Description

bp_core_catch_no_access(); 

Usage

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

Defined (1)

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

/bp-core/bp-core-catchuri.php  
  1. function bp_core_catch_no_access() { 
  2. global $wp_query; 
  3.  
  4. $bp =buddypress); 
  5.  
  6. // If coming from bp_core_redirect() and $bp_no_status_set is true,  
  7. // we are redirecting to an accessible page so skip this check. 
  8. if ( !empty( $bp->no_status_set ) ) 
  9. return false; 
  10.  
  11. if ( !isset( $wp_query->queried_object ) && !bp_is_blog_page() ) { 
  12. bp_do_404();