Changeset 5827 for trunk/src/includes/users/template.php
- Timestamp:
- 07/14/2015 12:31:42 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/users/template.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/template.php
r5815 r5827 336 336 * @param string $user_nicename Optional. User nicename 337 337 * @uses bbp_get_user_id() To get user id 338 * @uses WP_Rewrite::using_permalinks() To check if the blog is using 339 * permalinks 338 * @uses bbp_use_pretty_urls() To check if the site is using pretty URLs 340 339 * @uses add_query_arg() To add custom args to the url 341 340 * @uses home_url() To get blog home url … … 345 344 */ 346 345 function bbp_get_user_profile_url( $user_id = 0, $user_nicename = '' ) { 347 global $wp_rewrite;348 346 349 347 // Use displayed user ID if there is one, and one isn't requested … … 360 358 361 359 // Pretty permalinks 362 if ( $wp_rewrite->using_permalinks() ) {360 if ( bbp_use_pretty_urls() ) { 363 361 364 362 // Get username if not passed … … 367 365 } 368 366 369 $url = trailingslashit( $wp_rewrite->root. bbp_get_user_slug() ) . $user_nicename;367 $url = trailingslashit( bbp_get_root_url() . bbp_get_user_slug() ) . $user_nicename; 370 368 $url = user_trailingslashit( $url ); 371 369 $url = home_url( $url ); … … 439 437 * @uses bbp_get_user_id() To get user id 440 438 * @uses bbp_get_user_profile_url() To get the user profile url 441 * @uses WP_Rewrite::using_permalinks() To check if the blog is using 442 * permalinks 439 * @uses bbp_use_pretty_urls() To check if the site is using pretty URLs 443 440 * @uses add_query_arg() To add custom args to the url 444 441 * @uses home_url() To get blog home url … … 448 445 */ 449 446 function bbp_get_user_profile_edit_url( $user_id = 0, $user_nicename = '' ) { 450 global $wp_rewrite;451 447 452 448 $user_id = bbp_get_user_id( $user_id ); … … 465 461 466 462 // Pretty permalinks 467 if ( $wp_rewrite->using_permalinks() ) {463 if ( bbp_use_pretty_urls() ) { 468 464 $url = trailingslashit( $profile_url ) . 'edit'; 469 465 $url = user_trailingslashit( $url ); … … 820 816 */ 821 817 function bbp_get_favorites_permalink( $user_id = 0 ) { 822 global $wp_rewrite;823 818 824 819 // Use displayed user ID if there is one, and one isn't requested … … 838 833 839 834 // Pretty permalinks 840 if ( $wp_rewrite->using_permalinks() ) {835 if ( bbp_use_pretty_urls() ) { 841 836 $url = trailingslashit( $profile_url ) . bbp_get_user_favorites_rewrite_id(); 842 837 $url = user_trailingslashit( $url ); … … 980 975 */ 981 976 function bbp_get_subscriptions_permalink( $user_id = 0 ) { 982 global $wp_rewrite;983 977 984 978 // Use displayed user ID if there is one, and one isn't requested … … 998 992 999 993 // Pretty permalinks 1000 if ( $wp_rewrite->using_permalinks() ) {994 if ( bbp_use_pretty_urls() ) { 1001 995 $url = trailingslashit( $profile_url ) . bbp_get_user_subscriptions_slug(); 1002 996 $url = user_trailingslashit( $url ); … … 1421 1415 */ 1422 1416 function bbp_get_user_topics_created_url( $user_id = 0 ) { 1423 global $wp_rewrite;1424 1417 1425 1418 // Use displayed user ID if there is one, and one isn't requested … … 1439 1432 1440 1433 // Pretty permalinks 1441 if ( $wp_rewrite->using_permalinks() ) {1434 if ( bbp_use_pretty_urls() ) { 1442 1435 $url = trailingslashit( $profile_url ) . bbp_get_topic_archive_slug(); 1443 1436 $url = user_trailingslashit( $url ); … … 1479 1472 */ 1480 1473 function bbp_get_user_replies_created_url( $user_id = 0 ) { 1481 global $wp_rewrite;1482 1474 1483 1475 // Use displayed user ID if there is one, and one isn't requested … … 1497 1489 1498 1490 // Pretty permalinks 1499 if ( $wp_rewrite->using_permalinks() ) {1491 if ( bbp_use_pretty_urls() ) { 1500 1492 $url = trailingslashit( $profile_url ) . bbp_get_reply_archive_slug(); 1501 1493 $url = user_trailingslashit( $url );
Note: See TracChangeset
for help on using the changeset viewer.