Changeset 3917 for trunk/bp-members/bp-members-functions.php
- Timestamp:
- 01/25/2011 08:58:56 PM (14 years ago)
- Location:
- trunk/bp-members
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-functions.php
r3916 r3917 130 130 * @package BuddyPress Core 131 131 * @param $username str Username to check. 132 * @return false on no match133 * @return int the user ID of the matched user.134 */135 function bp_core_get_random_member() {136 global $bp;137 138 if ( isset( $_GET['random-member'] ) ) {139 $user = bp_core_get_users( array( 'type' => 'random', 'per_page' => 1 ) );140 bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) );141 }142 }143 add_action( 'wp', 'bp_core_get_random_member' );144 145 /**146 * Returns the user_id for a user based on their username.147 *148 * @package BuddyPress Core149 * @param $username str Username to check.150 132 * @global $wpdb WordPress DB access object. 151 133 * @return false on no match … … 242 224 // Check $username for empty spaces and default to nicename if found 243 225 if ( strstr( $username, ' ' ) ) 244 $username = bp_ users_get_user_nicename( $user_id );226 $username = bp_members_get_user_nicename( $user_id ); 245 227 246 228 // Add this to cache … … 265 247 * @return str the username of the matched user. 266 248 */ 267 function bp_ users_get_user_nicename( $user_id ) {249 function bp_members_get_user_nicename( $user_id ) { 268 250 global $bp; 269 251 270 if ( !$user_nicename = wp_cache_get( 'bp_ users_user_nicename_' . $user_id, 'bp' ) ) {252 if ( !$user_nicename = wp_cache_get( 'bp_members_user_nicename_' . $user_id, 'bp' ) ) { 271 253 $update_cache = true; 272 254 … … 303 285 // Add this to cache 304 286 if ( true == $update_cache && !empty( $user_nicename ) ) 305 wp_cache_set( 'bp_ users_user_nicename_' . $user_id, $user_nicename, 'bp' );306 307 return apply_filters( 'bp_ users_get_user_nicename', $user_nicename );287 wp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' ); 288 289 return apply_filters( 'bp_members_get_user_nicename', $user_nicename ); 308 290 } 309 291 … … 399 381 400 382 if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) { 401 if ( bp_is_active( ' profile' ) ) {383 if ( bp_is_active( 'xprofile' ) ) { 402 384 $fullname = xprofile_get_field_data( stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ), $user_id ); 403 385 … … 640 622 add_action( 'bp_make_spam_user', 'bp_core_remove_data' ); 641 623 642 function bp_ users_can_edit_settings() {624 function bp_members_can_edit_settings() { 643 625 if ( bp_is_my_profile() ) 644 626 return true;
Note: See TracChangeset
for help on using the changeset viewer.