Changeset 2974 for branches/plugin/bbp-includes/bbp-user-template.php
- Timestamp:
- 04/01/2011 04:01:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-user-template.php
r2973 r2974 247 247 */ 248 248 function bbp_get_user_profile_url( $user_id = 0, $user_nicename = '' ) { 249 global $ bbp;249 global $wp_rewrite, $bbp; 250 250 251 251 // Use displayed user ID if there is one, and one isn't requested … … 253 253 return false; 254 254 255 // No pretty permalinks 256 if ( empty( $wp_rewrite->permalink_structure ) ) { 257 $url = add_query_arg( array( 'bbp_user' => $user_id ), home_url( '/' ) ); 258 259 // Get URL safe user slug 260 } else { 261 $url = $bbp->user_slug . '/%bbp_user%'; 262 255 // Pretty permalinks 256 if ( $wp_rewrite->using_permalinks() ) { 257 $url = $wp_rewrite->root . $bbp->user_slug . '/%bbp_user%'; 258 259 // Get username if not passed 263 260 if ( empty( $user_nicename ) ) { 264 261 $user = get_userdata( $user_id ); 265 if ( !empty( $user->user_nicename ) ) 262 if ( !empty( $user->user_nicename ) ) { 266 263 $user_nicename = $user->user_nicename; 264 } 267 265 } 268 266 269 267 $url = str_replace( '%bbp_user%', $user_nicename, $url ); 270 268 $url = home_url( user_trailingslashit( $url ) ); 269 270 // Unpretty permalinks 271 } else { 272 $url = add_query_arg( array( 'bbp_user' => $user_id ), home_url( '/' ) ); 271 273 } 272 274 … … 341 343 return; 342 344 343 if ( empty( $wp_rewrite->permalink_structure ) ) {344 $url = add_query_arg( array( 'bbp_user' => $user_id, 'edit' => '1' ), home_url( '/' ) );345 } else {346 $url = $wp_rewrite->front . $bbp->user_slug . '/%bbp_user%/edit'; 347 345 // Pretty permalinks 346 if ( $wp_rewrite->using_permalinks() ) { 347 $url = $wp_rewrite->root . $bbp->user_slug . '/%bbp_user%/edit'; 348 349 // Get username if not passed 348 350 if ( empty( $user_nicename ) ) { 349 351 $user = get_userdata( $user_id ); 350 if ( !empty( $user->user_nicename ) ) 352 if ( !empty( $user->user_nicename ) ) { 351 353 $user_nicename = $user->user_nicename; 354 } 352 355 } 353 356 354 357 $url = str_replace( '%bbp_user%', $user_nicename, $url ); 355 358 $url = home_url( user_trailingslashit( $url ) ); 359 360 // Unpretty permalinks 361 } else { 362 $url = add_query_arg( array( 'bbp_user' => $user_id, 'edit' => '1' ), home_url( '/' ) ); 356 363 } 357 364
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)