Ticket #6694: 6694.02.patch
File 6694.02.patch, 1.7 KB (added by , 9 years ago) |
---|
-
src/bp-core/bp-core-catchuri.php
210 210 } 211 211 212 212 // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above. 213 if ( empty( $matches ) && bp_core_enable_root_profiles() ) {213 if ( empty( $matches ) && bp_core_enable_root_profiles() && ! empty( $bp_uri[0] ) ) { 214 214 215 215 // Switch field based on compat. 216 216 $field = bp_is_username_compatibility_mode() ? 'login' : 'slug'; 217 217 218 /** 219 * Filter the portion of the URI that is the displayed user's slug. 220 * 221 * eg. example.com/ADMIN (when root profiles is enabled) 222 * example.com/members/ADMIN (when root profiles isn't enabled) 223 * 224 * ADMIN would be the displayed user's slug. 225 * 226 * @since 2.6.0 227 * 228 * @param string $member_slug 229 */ 230 $member_slug = apply_filters( 'bp_core_set_uri_globals_member_slug', $bp_uri[0] ); 231 218 232 // Make sure there's a user corresponding to $bp_uri[0]. 219 if ( ! empty( $bp->pages->members ) && !empty( $bp_uri[0] ) && $root_profile = get_user_by( $field, $bp_uri[0]) ) {233 if ( ! empty( $bp->pages->members ) && $root_profile = get_user_by( $field, $member_slug ) ) { 220 234 221 235 // Force BP to recognize that this is a members page. 222 236 $matches[] = 1; … … 272 286 273 287 // Are we viewing a specific user? 274 288 if ( $after_member_slug ) { 289 290 /** This filter is documented in bp-core/bp-core-catchuri.php */ 291 $after_member_slug = apply_filters( 'bp_core_set_uri_globals_member_slug', $after_member_slug ); 292 275 293 // If root profile, we've already queried for the user. 276 294 if ( $root_profile instanceof WP_User ) { 277 295 $bp->displayed_user->id = $root_profile->ID;