Changeset 2974
- Timestamp:
- 04/01/2011 04:01:31 AM (15 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 4 edited
-
bbp-general-template.php (modified) (1 diff)
-
bbp-reply-template.php (modified) (1 diff)
-
bbp-topic-template.php (modified) (1 diff)
-
bbp-user-template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-general-template.php
r2970 r2974 978 978 return home_url(); 979 979 980 if ( !empty( $wp_rewrite->permalink_structure ) ) { 981 $url = $wp_rewrite->front . $bbp->view_slug . '/' . $view; 980 // Pretty permalinks 981 if ( $wp_rewrite->using_permalinks() ) { 982 $url = $wp_rewrite->root . $bbp->view_slug . '/' . $view; 982 983 $url = home_url( user_trailingslashit( $url ) ); 984 985 // Unpretty permalinks 983 986 } else { 984 987 $url = add_query_arg( array( 'bbp_view' => $view ), home_url( '/' ) ); -
branches/plugin/bbp-includes/bbp-reply-template.php
r2972 r2974 1323 1323 return; 1324 1324 1325 if ( empty( $wp_rewrite->permalink_structure ) ) { 1325 // Pretty permalinks 1326 if ( $wp_rewrite->using_permalinks() ) { 1327 $url = $wp_rewrite->root . $bbp->reply_slug . '/' . $reply->post_name . '/edit'; 1328 $url = home_url( user_trailingslashit( $url ) ); 1329 1330 // Unpretty permalinks 1331 } else { 1326 1332 $url = add_query_arg( array( bbp_get_reply_post_type() => $reply->post_name, 'edit' => '1' ), home_url( '/' ) ); 1327 } else {1328 $url = $wp_rewrite->front . $bbp->reply_slug . '/' . $reply->post_name . '/edit';1329 $url = home_url( user_trailingslashit( $url ) );1330 1333 } 1331 1334 -
branches/plugin/bbp-includes/bbp-topic-template.php
r2972 r2974 1904 1904 return; 1905 1905 1906 if ( empty( $wp_rewrite->permalink_structure ) ) { 1906 // Pretty permalinks 1907 if ( $wp_rewrite->using_permalinks() ) { 1908 $url = $wp_rewrite->root . $bbp->topic_slug . '/' . $topic->post_name . '/edit'; 1909 $url = home_url( user_trailingslashit( $url ) ); 1910 1911 // Unpretty permalinks 1912 } else { 1907 1913 $url = add_query_arg( array( bbp_get_topic_post_type() => $topic->post_name, 'edit' => '1' ), home_url( '/' ) ); 1908 } else {1909 $url = $wp_rewrite->front . $bbp->topic_slug . '/' . $topic->post_name . '/edit';1910 $url = home_url( user_trailingslashit( $url ) );1911 1914 } 1912 1915 -
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.