bp_core_get_random_member

Redirect to a random member page when visiting a ?random-member URL.

Description

bp_core_get_random_member(); 

Usage

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

Defined (1)

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

/bp-members/bp-members-actions.php  
  1. function bp_core_get_random_member() { 
  2. if ( ! isset( $_GET['random-member'] ) ) 
  3. return; 
  4.  
  5. $user = bp_core_get_users( array( 'type' => 'random', 'per_page' => 1 ) ); 
  6. bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) );