Changeset 13443
- Timestamp:
- 03/31/2023 05:26:39 PM (18 months ago)
- Location:
- trunk/src
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/actions/feeds.php
r13433 r13443 25 25 26 26 // Setup the feed. 27 buddypress()->activity->feed = new BP_Activity_Feed( array( 28 'id' => 'sitewide', 29 30 /* translators: %s Site Name */ 31 'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ), 32 'link' => $link, 33 'description' => __( 'Activity feed for the entire site.', 'buddypress' ), 34 'activity_args' => 'display_comments=threaded' 35 ) ); 27 buddypress()->activity->feed = new BP_Activity_Feed( 28 array( 29 'id' => 'sitewide', 30 31 /* translators: %s Site Name */ 32 'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ), 33 'link' => $link, 34 'description' => __( 'Activity feed for the entire site.', 'buddypress' ), 35 'activity_args' => 'display_comments=threaded' 36 ) 37 ); 36 38 37 39 if ( ! buddypress()->activity->feed->enabled ) { … … 53 55 } 54 56 55 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ); 56 57 // Setup the feed. 58 buddypress()->activity->feed = new BP_Activity_Feed( array( 59 'id' => 'personal', 60 61 /* translators: 1: Site Name. 2: User Display Name. */ 62 'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 63 'link' => $link, 64 65 /* translators: %s: User Display Name */ 66 'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ), 67 'activity_args' => 'user_id=' . bp_displayed_user_id() 68 ) ); 57 $activity_slug = bp_get_activity_slug(); 58 $link = bp_displayed_user_url( 59 array( 60 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 61 ) 62 ); 63 64 // Setup the feed. 65 buddypress()->activity->feed = new BP_Activity_Feed( 66 array( 67 'id' => 'personal', 68 69 /* translators: 1: Site Name. 2: User Display Name. */ 70 'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 71 'link' => $link, 72 73 /* translators: %s: User Display Name */ 74 'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ), 75 'activity_args' => 'user_id=' . bp_displayed_user_id() 76 ) 77 ); 69 78 70 79 if ( ! buddypress()->activity->feed->enabled ) { … … 86 95 } 87 96 88 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ); 89 90 // Setup the feed. 91 buddypress()->activity->feed = new BP_Activity_Feed( array( 92 'id' => 'friends', 93 94 /* translators: 1: Site Name 2: User Display Name */ 95 'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 96 'link' => $link, 97 98 /* translators: %s: User Display Name */ 99 'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ), 100 'activity_args' => 'scope=friends' 101 ) ); 97 $activity_slug = bp_get_activity_slug(); 98 $friends_slug = bp_get_friends_slug(); 99 $link = bp_displayed_user_url( 100 array( 101 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 102 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug ), 103 ) 104 ); 105 106 // Setup the feed. 107 buddypress()->activity->feed = new BP_Activity_Feed( 108 array( 109 'id' => 'friends', 110 111 /* translators: 1: Site Name 2: User Display Name */ 112 'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 113 'link' => $link, 114 115 /* translators: %s: User Display Name */ 116 'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ), 117 'activity_args' => 'scope=friends' 118 ) 119 ); 102 120 103 121 if ( ! buddypress()->activity->feed->enabled ) { … … 120 138 121 139 // Get displayed user's group IDs. 122 $groups = groups_get_user_groups(); 123 $group_ids = implode( ',', $groups['groups'] ); 124 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ); 125 126 // Setup the feed. 127 buddypress()->activity->feed = new BP_Activity_Feed( array( 128 'id' => 'mygroups', 129 130 /* translators: 1: Site Name 2: User Display Name */ 131 'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 132 'link' => $link, 133 134 /* translators: %s: User Display Name */ 135 'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ), 136 'activity_args' => array( 137 'object' => buddypress()->groups->id, 138 'primary_id' => $group_ids, 139 'display_comments' => 'threaded' 140 ) 141 ) ); 140 $groups = groups_get_user_groups(); 141 $group_ids = implode( ',', $groups['groups'] ); 142 $activity_slug = bp_get_activity_slug(); 143 $groups_slug = bp_get_groups_slug(); 144 $link = bp_displayed_user_url( 145 array( 146 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 147 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug ), 148 ) 149 ); 150 151 // Setup the feed. 152 buddypress()->activity->feed = new BP_Activity_Feed( 153 array( 154 'id' => 'mygroups', 155 156 /* translators: 1: Site Name 2: User Display Name */ 157 'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 158 'link' => $link, 159 160 /* translators: %s: User Display Name */ 161 'description' => sprintf( __( 'Public group activity feed of which %s is a member.', 'buddypress' ), bp_get_displayed_user_fullname() ), 162 'activity_args' => array( 163 'object' => buddypress()->groups->id, 164 'primary_id' => $group_ids, 165 'display_comments' => 'threaded' 166 ) 167 ) 168 ); 142 169 143 170 if ( ! buddypress()->activity->feed->enabled ) { … … 163 190 } 164 191 165 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions' ); 166 167 // Setup the feed. 168 buddypress()->activity->feed = new BP_Activity_Feed( array( 169 'id' => 'mentions', 170 171 /* translators: 1: Site Name 2: User Display Name */ 172 'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 173 'link' => $link, 174 175 /* translators: %s: User Display Name */ 176 'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ), 177 'activity_args' => array( 178 'search_terms' => '@' . bp_members_get_user_slug( bp_displayed_user_id() ) 179 ) 180 ) ); 192 $activity_slug = bp_get_activity_slug(); 193 $link = bp_displayed_user_url( 194 array( 195 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 196 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 197 ) 198 ); 199 200 // Setup the feed. 201 buddypress()->activity->feed = new BP_Activity_Feed( 202 array( 203 'id' => 'mentions', 204 205 /* translators: 1: Site Name 2: User Display Name */ 206 'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 207 'link' => $link, 208 209 /* translators: %s: User Display Name */ 210 'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ), 211 'activity_args' => array( 212 'search_terms' => '@' . bp_members_get_user_slug( bp_displayed_user_id() ) 213 ) 214 ) 215 ); 181 216 182 217 if ( ! buddypress()->activity->feed->enabled ) { … … 199 234 200 235 // Get displayed user's favorite activity IDs. 201 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 202 $fav_ids = implode( ',', (array) $favs ); 203 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites' ); 204 205 // Setup the feed. 206 buddypress()->activity->feed = new BP_Activity_Feed( array( 207 'id' => 'favorites', 208 209 /* translators: 1: Site Name 2: User Display Name */ 210 'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 211 'link' => $link, 212 213 /* translators: %s: User Display Name */ 214 'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ), 215 'activity_args' => 'include=' . $fav_ids 216 ) ); 236 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 237 $fav_ids = implode( ',', (array) $favs ); 238 $activity_slug = bp_get_activity_slug(); 239 $link = bp_displayed_user_url( 240 array( 241 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 242 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 243 ) 244 ); 245 246 // Setup the feed. 247 buddypress()->activity->feed = new BP_Activity_Feed( 248 array( 249 'id' => 'favorites', 250 251 /* translators: 1: Site Name 2: User Display Name */ 252 'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 253 'link' => $link, 254 255 /* translators: %s: User Display Name */ 256 'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ), 257 'activity_args' => 'include=' . $fav_ids 258 ) 259 ); 217 260 218 261 if ( ! buddypress()->activity->feed->enabled ) { -
trunk/src/bp-activity/bp-activity-template.php
r13437 r13443 3909 3909 * 3910 3910 * @since 1.2.0 3911 *3912 3911 */ 3913 3912 function bp_member_activity_feed_link() { 3914 echo bp_get_member_activity_feed_link(); 3915 } 3916 3917 /** 3918 * Output the member activity feed link. 3919 * 3920 * @since 1.0.0 3921 * @deprecated 1.2.0 3922 * 3923 * @todo properly deprecate in favor of bp_member_activity_feed_link(). 3924 * 3925 */ 3926 function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link(); } 3913 echo esc_url( bp_get_member_activity_feed_link() ); 3914 } 3927 3915 3928 3916 /** … … 3931 3919 * @since 1.2.0 3932 3920 * 3933 *3934 3921 * @return string $link The member activity feed link. 3935 3922 */ 3936 3923 function bp_get_member_activity_feed_link() { 3924 $activity_slug = bp_get_activity_slug(); 3925 $path_chunks = array( 3926 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 3927 ); 3937 3928 3938 3929 // Single member activity feed link. 3939 3930 if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) { 3940 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/feed/'; 3931 $path_chunks['single_item_action'] = 'feed'; 3932 $link = bp_displayed_user_url( $path_chunks ); 3941 3933 3942 3934 // Friend feed link. 3943 3935 } elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) ) { 3944 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed/'; 3936 $friends_slug = bp_get_friends_slug(); 3937 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug ); 3938 $path_chunks['single_item_action_variables'] = array( 'feed' ); 3939 $link = bp_displayed_user_url( $path_chunks ); 3945 3940 3946 3941 // Group feed link. 3947 3942 } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { 3948 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/'; 3943 $groups_slug = bp_get_groups_slug(); 3944 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug ); 3945 $path_chunks['single_item_action_variables'] = array( 'feed' ); 3946 $link = bp_displayed_user_url( $path_chunks ); 3949 3947 3950 3948 // Favorites activity feed link. 3951 3949 } elseif ( 'favorites' === bp_current_action() ) { 3952 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/'; 3950 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ); 3951 $path_chunks['single_item_action_variables'] = array( 'feed' ); 3952 $link = bp_displayed_user_url( $path_chunks ); 3953 3953 3954 3954 // Mentions activity feed link. 3955 3955 } elseif ( ( 'mentions' === bp_current_action() ) && bp_activity_do_mentions() ) { 3956 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/'; 3956 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ); 3957 $path_chunks['single_item_action_variables'] = array( 'feed' ); 3958 $link = bp_displayed_user_url( $path_chunks ); 3957 3959 3958 3960 // No feed link. -
trunk/src/bp-blogs/bp-blogs-template.php
r13436 r13443 1387 1387 1388 1388 /** 1389 * Output navigation tabs for a user Blogs page.1390 *1391 * Currently unused by BuddyPress.1392 */1393 function bp_blogs_blog_tabs() {1394 1395 // Don't show these tabs on a user's own profile.1396 if ( bp_is_my_profile() ) {1397 return false;1398 } ?>1399 1400 <ul class="content-header-nav">1401 <li<?php if ( bp_is_current_action( 'my-blogs' ) || !bp_current_action() ) : ?> class="current"<?php endif; ?>>1402 <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/my-blogs' ); ?>">1403 <?php1404 /* translators: %s: the User Display Name */1405 printf( __( "%s's Sites", 'buddypress' ), bp_get_displayed_user_fullname() );1406 ?>1407 </a>1408 </li>1409 <li<?php if ( bp_is_current_action( 'recent-posts' ) ) : ?> class="current"<?php endif; ?>>1410 <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/recent-posts' ); ?>">1411 <?php1412 /* translators: %s: the User Display Name */1413 printf( __( "%s's Recent Posts", 'buddypress' ), bp_get_displayed_user_fullname() );1414 ?>1415 </a>1416 </li>1417 <li<?php if ( bp_is_current_action( 'recent-comments' ) ) : ?> class="current"<?php endif; ?>>1418 <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/recent-comments' ); ?>">1419 <?php1420 /* translators: %s: the User Display Name */1421 printf( __( "%s's Recent Comments", 'buddypress' ), bp_get_displayed_user_fullname() );1422 ?>1423 </a>1424 </li>1425 </ul>1426 1427 <?php1428 1429 /**1430 * Fires after the markup for the navigation tabs for a user Blogs page.1431 *1432 * @since 1.0.01433 */1434 do_action( 'bp_blogs_blog_tabs' );1435 }1436 1437 /**1438 1389 * Output the blog directory search form. 1390 * 1391 * @since 1.9.0 1439 1392 */ 1440 1393 function bp_directory_blogs_search_form() { -
trunk/src/bp-core/bp-core-buddybar.php
r13441 r13443 751 751 if ( bp_is_my_profile() || ( isset( $parent_nav_default_item ) && $parent_nav_default_item->show_for_displayed_user ) ) { 752 752 $message = __( 'You do not have access to that page.', 'buddypress' ); 753 $redirect_to = bp_displayed_user_ domain();753 $redirect_to = bp_displayed_user_url(); 754 754 755 755 // In some cases, the default tab is not accessible to … … 759 759 // Try 'activity' first. 760 760 if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { 761 $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ); 761 $activity_slug = bp_get_activity_slug(); 762 $redirect_to = bp_displayed_user_url( 763 array( 764 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 765 ) 766 ); 762 767 // Then try 'profile'. 763 768 } else { 764 $redirect_to = trailingslashit( bp_displayed_user_domain() . ( 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id ) ); 769 $profile_slug = bp_get_profile_slug(); 770 $redirect_to = bp_displayed_user_url( 771 array( 772 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 773 ) 774 ); 765 775 } 766 776 767 $message 777 $message = ''; 768 778 } 769 779 -
trunk/src/bp-core/bp-core-template.php
r13441 r13443 3205 3205 3206 3206 // If on the user profile's landing page, just use the fullname. 3207 if ( bp_is_current_component( $bp->default_component ) && ( bp_get_requested_url() === bp_displayed_user_ domain() ) ) {3207 if ( bp_is_current_component( $bp->default_component ) && ( bp_get_requested_url() === bp_displayed_user_url() ) ) { 3208 3208 $bp_title_parts[] = $displayed_user_name; 3209 3209 -
trunk/src/bp-core/deprecated/1.2.php
r13108 r13443 53 53 } 54 54 55 55 /** 56 * Output the member activity feed link. 57 * 58 * @since 1.0.0 59 * @deprecated 1.2.0 60 */ 61 function bp_activities_member_rss_link() { 62 _deprecated_function( __FUNCTION__, '1.2', 'bp_member_activity_feed_link()' ); 63 bp_member_activity_feed_link(); 64 } -
trunk/src/bp-core/deprecated/12.0.php
r13437 r13443 343 343 bp_group_creation_tabs(); 344 344 } 345 346 /** 347 * Displays group header tabs. 348 * 349 * @since 1.0.0 350 * @deprecated 12.0.0 351 */ 352 function bp_groups_header_tabs() { 353 _deprecated_function( __FUNCTION__, '12.0.0' ); 354 $user_groups = bp_displayed_user_url() . bp_get_groups_slug(); ?> 355 356 <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/recently-active' ); ?>"><?php _e( 'Recently Active', 'buddypress' ); ?></a></li> 357 <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/recently-joined' ); ?>"><?php _e( 'Recently Joined', 'buddypress' ); ?></a></li> 358 <li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/most-popular' ); ?>"><?php _e( 'Most Popular', 'buddypress' ); ?></a></li> 359 <li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/admin-of' ); ?>"><?php _e( 'Administrator Of', 'buddypress' ); ?></a></li> 360 <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/mod-of' ); ?>"><?php _e( 'Moderator Of', 'buddypress' ); ?></a></li> 361 <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/alphabetically' ); ?>"><?php _e( 'Alphabetically', 'buddypress' ); ?></a></li> 362 363 <?php 364 /** 365 * Fires after the markup for the navigation tabs for a user Groups page. 366 * 367 * @since 1.0.0 368 * @deprecated 12.0.0 369 */ 370 do_action_deprecated( 'groups_header_tabs', array(), '12.0.0' ); 371 } 372 373 /** 374 * Output navigation tabs for a user Blogs page. 375 * 376 * Currently unused by BuddyPress. 377 * 378 * @since 1.0.0 379 * @deprecated 12.0.0 380 */ 381 function bp_blogs_blog_tabs() { 382 383 // Don't show these tabs on a user's own profile. 384 if ( bp_is_my_profile() ) { 385 return false; 386 } ?> 387 388 <ul class="content-header-nav"> 389 <li<?php if ( bp_is_current_action( 'my-blogs' ) || !bp_current_action() ) : ?> class="current"<?php endif; ?>> 390 <a href="<?php bp_displayed_user_link( array( bp_get_blogs_slug(), 'my-blogs' ) ); ?>"> 391 <?php 392 /* translators: %s: the User Display Name */ 393 printf( esc_html__( "%s's Sites", 'buddypress' ), bp_get_displayed_user_fullname() ); 394 ?> 395 </a> 396 </li> 397 <li<?php if ( bp_is_current_action( 'recent-posts' ) ) : ?> class="current"<?php endif; ?>> 398 <a href="<?php bp_displayed_user_link( array( bp_get_blogs_slug(), 'recent-posts' ) ); ?>"> 399 <?php 400 /* translators: %s: the User Display Name */ 401 printf( esc_html__( "%s's Recent Posts", 'buddypress' ), bp_get_displayed_user_fullname() ); 402 ?> 403 </a> 404 </li> 405 <li<?php if ( bp_is_current_action( 'recent-comments' ) ) : ?> class="current"<?php endif; ?>> 406 <a href="<?php bp_displayed_user_link( array( bp_get_blogs_slug(), 'recent-comments' ) ); ?>"> 407 <?php 408 /* translators: %s: the User Display Name */ 409 printf( esc_html__( "%s's Recent Comments", 'buddypress' ), bp_get_displayed_user_fullname() ); 410 ?> 411 </a> 412 </li> 413 </ul> 414 415 <?php 416 417 /** 418 * Fires after the markup for the navigation tabs for a user Blogs page. 419 * 420 * @since 1.0.0 421 * @deprecated 12.0.0 422 */ 423 do_action_deprecated( 'bp_blogs_blog_tabs', array(), '12.0.0' ); 424 } -
trunk/src/bp-friends/bp-friends-template.php
r13441 r13443 89 89 90 90 <span> 91 <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() )?>">91 <a href="<?php bp_displayed_user_link( array( bp_get_friends_slug() ) ); ?>"> 92 92 <?php esc_html_e( 'See All', 'buddypress' ) ?> 93 93 </a> … … 203 203 */ 204 204 function bp_friend_search_form() { 205 206 $action = bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/search/'; 207 $label = __( 'Filter Friends', 'buddypress' ); ?> 208 209 <form action="<?php echo $action ?>" id="friend-search-form" method="post"> 210 211 <label for="friend-search-box" id="friend-search-label"><?php echo $label ?></label> 212 <input type="search" name="friend-search-box" id="friend-search-box" value="<?php echo $value ?>"<?php echo $disabled ?> /> 205 $label = __( 'Filter Friends', 'buddypress' ); 206 $friends_slug = bp_get_friends_slug(); 207 $action = bp_displayed_user_url( 208 array( 209 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 210 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ), 211 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_search', 'search' ) ), 212 ) 213 ); 214 ?> 215 216 <form action="<?php echo esc_url( $action ) ?>" id="friend-search-form" method="post"> 217 218 <label for="friend-search-box" id="friend-search-label"><?php echo esc_html( $label ); ?></label> 219 <input type="search" name="friend-search-box" id="friend-search-box" value="" /> 213 220 214 221 <?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?> -
trunk/src/bp-friends/classes/class-bp-core-friends-widget.php
r13395 r13443 68 68 69 69 $user_id = bp_displayed_user_id(); 70 $link = trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() ); 70 $friends_slug = bp_get_friends_slug(); 71 $link = bp_displayed_user_url( 72 array( 73 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 74 ) 75 ); 71 76 $instance['title'] = sprintf( __( "%s's Friends", 'buddypress' ), bp_get_displayed_user_fullname() ); 72 77 -
trunk/src/bp-groups/bp-groups-template.php
r13441 r13443 2168 2168 */ 2169 2169 function bp_group_search_form() { 2170 2171 $action = bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/search/'; 2172 $label = __('Filter Groups', 'buddypress'); 2173 $name = 'group-filter-box'; 2174 2175 $search_form_html = '<form action="' . $action . '" id="group-search-form" method="post"> 2176 <label for="'. $name .'" id="'. $name .'-label">'. $label .'</label> 2177 <input type="search" name="'. $name . '" id="'. $name .'" value="'. $value .'"'. $disabled .' /> 2170 $label = __('Filter Groups', 'buddypress'); 2171 $name = 'group-filter-box'; 2172 $groups_slug = bp_get_groups_slug(); 2173 $action = bp_displayed_user_url( 2174 array( 2175 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 2176 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' ), 2177 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_search', 'search' ) ), 2178 ) 2179 ); 2180 2181 $search_form_html = '<form action="' . esc_url( $action ) . '" id="group-search-form" method="post"> 2182 <label for="'. $name .'" id="'. $name .'-label">'. esc_html( $label ) .'</label> 2183 <input type="search" name="'. $name . '" id="'. $name .'" value=""/> 2178 2184 2179 2185 '. wp_nonce_field( 'group-filter-box', '_wpnonce_group_filter', true, false ) .' … … 5738 5744 5739 5745 /** 5740 * Displays group header tabs.5741 *5742 * @since 1.0.05743 *5744 * @todo Deprecate?5745 */5746 function bp_groups_header_tabs() {5747 $user_groups = bp_displayed_user_domain() . bp_get_groups_slug(); ?>5748 5749 <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/recently-active' ); ?>"><?php _e( 'Recently Active', 'buddypress' ); ?></a></li>5750 <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/recently-joined' ); ?>"><?php _e( 'Recently Joined', 'buddypress' ); ?></a></li>5751 <li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/most-popular' ); ?>"><?php _e( 'Most Popular', 'buddypress' ); ?></a></li>5752 <li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/admin-of' ); ?>"><?php _e( 'Administrator Of', 'buddypress' ); ?></a></li>5753 <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/mod-of' ); ?>"><?php _e( 'Moderator Of', 'buddypress' ); ?></a></li>5754 <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/alphabetically' ); ?>"><?php _e( 'Alphabetically', 'buddypress' ); ?></a></li>5755 5756 <?php5757 do_action( 'groups_header_tabs' );5758 }5759 5760 /**5761 5746 * Displays group filter titles. 5762 5747 * -
trunk/src/bp-groups/screens/user/invites.php
r13273 r13443 42 42 $redirect_to = urldecode( $_GET['redirect_to'] ); 43 43 } else { 44 $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ); 44 $path_chunks = bp_members_get_path_chunks( array( bp_get_groups_slug(), bp_current_action() ) ); 45 $redirect_to = bp_displayed_user_url( $path_chunks ); 45 46 } 46 47 … … 61 62 $redirect_to = urldecode( $_GET['redirect_to'] ); 62 63 } else { 63 $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ); 64 $path_chunks = bp_members_get_path_chunks( array( bp_get_groups_slug(), bp_current_action() ) ); 65 $redirect_to = bp_displayed_user_url( $path_chunks ); 64 66 } 65 67 -
trunk/src/bp-members/actions/invitations-bulk-manage.php
r12951 r13443 77 77 } 78 78 79 $invite_slug = bp_get_members_invitations_slug(); 80 $action_slug = bp_current_action(); 81 $action_rewrite_id = str_replace( '-', '_', $action_slug ); 82 83 $path_chunks = array( 84 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug, $invite_slug ), 85 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug . '_' . $action_rewrite_id, $action_slug ), 86 ); 87 79 88 // Redirect. 80 bp_core_redirect( bp_displayed_user_ domain() . bp_get_members_invitations_slug() . '/' . bp_current_action() . '/');89 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 81 90 } 82 91 add_action( 'bp_actions', 'bp_members_invitations_action_bulk_manage' ); -
trunk/src/bp-members/bp-members-adminbar.php
r13441 r13443 83 83 84 84 // Only show if viewing a user. 85 if ( ! bp_is_user() )85 if ( ! bp_is_user() ) { 86 86 return false; 87 } 87 88 88 89 // Don't show this menu to non site admins or if you're viewing your own profile. 89 if ( ! current_user_can( 'edit_users' ) || bp_is_my_profile() )90 if ( ! current_user_can( 'edit_users' ) || bp_is_my_profile() ) { 90 91 return false; 92 } 91 93 92 94 $bp = buddypress(); … … 96 98 97 99 // Add the top-level User Admin button. 98 $wp_admin_bar->add_node( array( 99 'id' => $bp->user_admin_menu_id, 100 'title' => __( 'Edit Member', 'buddypress' ), 101 'href' => bp_displayed_user_domain() 102 ) ); 100 $wp_admin_bar->add_node( 101 array( 102 'id' => $bp->user_admin_menu_id, 103 'title' => __( 'Edit Member', 'buddypress' ), 104 'href' => bp_displayed_user_url() 105 ) 106 ); 103 107 104 108 if ( bp_is_active( 'xprofile' ) ) { 105 109 // User Admin > Edit this user's profile. 106 $wp_admin_bar->add_node( array( 107 'parent' => $bp->user_admin_menu_id, 108 'id' => $bp->user_admin_menu_id . '-edit-profile', 109 'title' => __( "Edit Profile", 'buddypress' ), 110 'href' => bp_get_members_component_link( $bp->profile->id, 'edit' ) 111 ) ); 110 $wp_admin_bar->add_node( 111 array( 112 'parent' => $bp->user_admin_menu_id, 113 'id' => $bp->user_admin_menu_id . '-edit-profile', 114 'title' => __( "Edit Profile", 'buddypress' ), 115 'href' => bp_get_members_component_link( $bp->profile->id, 'edit' ), 116 ) 117 ); 112 118 113 119 // User Admin > Edit this user's avatar. 114 120 if ( buddypress()->avatar->show_avatars ) { 115 $wp_admin_bar->add_node( array( 116 'parent' => $bp->user_admin_menu_id, 117 'id' => $bp->user_admin_menu_id . '-change-avatar', 118 'title' => __( "Edit Profile Photo", 'buddypress' ), 119 'href' => bp_get_members_component_link( $bp->profile->id, 'change-avatar' ) 120 ) ); 121 $wp_admin_bar->add_node( 122 array( 123 'parent' => $bp->user_admin_menu_id, 124 'id' => $bp->user_admin_menu_id . '-change-avatar', 125 'title' => __( "Edit Profile Photo", 'buddypress' ), 126 'href' => bp_get_members_component_link( $bp->profile->id, 'change-avatar' ), 127 ) 128 ); 121 129 } 122 130 123 131 // User Admin > Edit this user's cover image. 124 132 if ( bp_displayed_user_use_cover_image_header() ) { 125 $wp_admin_bar->add_node( array( 126 'parent' => $bp->user_admin_menu_id, 127 'id' => $bp->user_admin_menu_id . '-change-cover-image', 128 'title' => __( 'Edit Cover Image', 'buddypress' ), 129 'href' => bp_get_members_component_link( $bp->profile->id, 'change-cover-image' ) 130 ) ); 133 $wp_admin_bar->add_node( 134 array( 135 'parent' => $bp->user_admin_menu_id, 136 'id' => $bp->user_admin_menu_id . '-change-cover-image', 137 'title' => __( 'Edit Cover Image', 'buddypress' ), 138 'href' => bp_get_members_component_link( $bp->profile->id, 'change-cover-image' ), 139 ) 140 ); 131 141 } 132 142 … … 135 145 if ( bp_is_active( 'settings' ) ) { 136 146 // User Admin > Spam/unspam. 137 $wp_admin_bar->add_node( array( 138 'parent' => $bp->user_admin_menu_id, 139 'id' => $bp->user_admin_menu_id . '-user-capabilities', 140 'title' => __( 'User Capabilities', 'buddypress' ), 141 'href' => bp_displayed_user_domain() . 'settings/capabilities/' 142 ) ); 147 $wp_admin_bar->add_node( 148 array( 149 'parent' => $bp->user_admin_menu_id, 150 'id' => $bp->user_admin_menu_id . '-user-capabilities', 151 'title' => __( 'User Capabilities', 'buddypress' ), 152 'href' => bp_get_members_component_link( $bp->settings->id, 'capabilities' ), 153 ) 154 ); 143 155 144 156 // User Admin > Delete Account. 145 $wp_admin_bar->add_node( array(146 'parent' => $bp->user_admin_menu_id,147 'id' => $bp->user_admin_menu_id . '-delete-user',148 'title' => __( 'Delete Account', 'buddypress' ),149 'href' => bp_displayed_user_domain() . 'settings/delete-account/'150 ) );151 152 }153 157 $wp_admin_bar->add_node( 158 array( 159 'parent' => $bp->user_admin_menu_id, 160 'id' => $bp->user_admin_menu_id . '-delete-user', 161 'title' => __( 'Delete Account', 'buddypress' ), 162 'href' => bp_get_members_component_link( $bp->settings->id, 'delete-account' ), 163 ) 164 ); 165 } 154 166 } 155 167 add_action( 'admin_bar_menu', 'bp_members_admin_bar_user_admin_menu', 99 ); -
trunk/src/bp-members/bp-members-functions.php
r13436 r13443 137 137 */ 138 138 return apply_filters( 'bp_core_get_users', $retval, $r ); 139 } 140 141 /** 142 * Get members path chunks using an array of URL slugs. 143 * 144 * @since 12.0.0 145 * 146 * @param array $chunks An array of URL slugs. 147 * @return array An array of BP Rewrites URL arguments. 148 */ 149 function bp_members_get_path_chunks( $chunks = array() ) { 150 $path_chunks = array(); 151 152 $single_item_component = array_shift( $chunks ); 153 $item_component_rewrite_id_suffix = ''; 154 if ( $single_item_component ) { 155 $item_component_rewrite_id_suffix = str_replace( '-', '_', $single_item_component ); 156 $path_chunks['single_item_component'] = bp_rewrites_get_slug( 'members', 'member_' . $item_component_rewrite_id_suffix, $single_item_component ); 157 } 158 159 $single_item_action = array_shift( $chunks ); 160 $item_action_rewrite_id_suffix = ''; 161 if ( $single_item_action ) { 162 $item_action_rewrite_id_suffix = str_replace( '-', '_', $single_item_action ); 163 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $item_component_rewrite_id_suffix . '_' . $item_action_rewrite_id_suffix, $single_item_action ); 164 } 165 166 if ( $chunks && $item_component_rewrite_id_suffix && $item_component_rewrite_id_suffix ) { 167 foreach ( $chunks as $chunk ) { 168 $item_action_variable_rewrite_id_suffix = str_replace( '-', '_', $chunk ); 169 $path_chunks['single_item_action_variables'][] = bp_rewrites_get_slug( 'members', 'member_' . $item_component_rewrite_id_suffix . '_' . $item_action_rewrite_id_suffix . '_' . $item_action_variable_rewrite_id_suffix, $chunk ); 170 } 171 } 172 173 return $path_chunks; 139 174 } 140 175 -
trunk/src/bp-members/bp-members-template.php
r13442 r13443 1876 1876 * 1877 1877 * @since 1.2.4 1878 */ 1879 function bp_displayed_user_link() { 1880 echo esc_url( bp_displayed_user_url() ); 1878 * @since 12.0.0 Introduced the `$chunk` argument. 1879 * 1880 * @param array $chunk A list of slugs to append to the URL. 1881 */ 1882 function bp_displayed_user_link( $chunks = array() ) { 1883 $path_chunks = array(); 1884 $chunks = (array) $chunks; 1885 1886 if ( $chunks ) { 1887 $path_chunks = bp_members_get_path_chunks( $chunks ); 1888 } 1889 1890 echo esc_url( bp_displayed_user_url( $path_chunks ) ); 1881 1891 } 1882 1892 … … 1962 1972 1963 1973 if ( $chunks ) { 1964 $single_item_component = array_shift( $chunks ); 1965 if ( $single_item_component ) { 1966 $path_chunks['single_item_component'] = bp_rewrites_get_slug( 'members', 'member_' . $single_item_component, $single_item_component ); 1967 } 1968 1969 $single_item_action = array_shift( $chunks ); 1970 if ( $single_item_action ) { 1971 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $single_item_component . '_' . $single_item_action, $single_item_action ); 1972 } 1973 1974 if ( $chunks ) { 1975 foreach ( $chunks as $chunk ) { 1976 $path_chunks['single_item_action_variables'][] = bp_rewrites_get_slug( 'members', 'member_' . $single_item_component . '_' . $single_item_action . '_' . $chunk, $chunk ); 1977 } 1978 } 1974 $path_chunks = bp_members_get_path_chunks( $chunks ); 1979 1975 } 1980 1976 … … 3098 3094 } 3099 3095 3096 $path_chunks = array( 3097 'single_item_component' => $bp->{$component}->slug, 3098 ); 3099 3100 3100 // Append $action to $url if there is no $type. 3101 3101 if ( ! empty( $action ) ) { 3102 $url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action; 3103 } else { 3104 $url = bp_displayed_user_domain() . $bp->{$component}->slug; 3102 $action_rewrite_id = 'member_' . str_replace( '-', '_', $action ); 3103 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', $action_rewrite_id, $action ); 3105 3104 } 3106 3105 3107 3106 // Add a slash at the end of our user url. 3108 $url = trailingslashit( $url);3107 $url = bp_displayed_user_url( $path_chunks ); 3109 3108 3110 3109 // Add possible query arg. … … 3145 3144 */ 3146 3145 function bp_get_avatar_delete_link() { 3146 $profile_slug = bp_get_profile_slug(); 3147 $url = wp_nonce_url( 3148 bp_displayed_user_url( 3149 array( 3150 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 3151 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_change_avatar', 'change-avatar' ), 3152 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_delete_avatar', 'delete-avatar' ) ), 3153 ) 3154 ), 3155 'bp_delete_avatar_link' 3156 ); 3147 3157 3148 3158 /** … … 3151 3161 * @since 1.1.0 3152 3162 * 3153 * @param string $ valueNonced URL used for deleting an avatar.3154 */ 3155 return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ));3163 * @param string $url Nonced URL used for deleting an avatar. 3164 */ 3165 return apply_filters( 'bp_get_avatar_delete_link', $url ); 3156 3166 } 3157 3167 -
trunk/src/bp-members/classes/class-bp-members-component.php
r13442 r13443 384 384 385 385 if ( bp_displayed_user_id() ) { 386 $bp->canonical_stack['base_url'] = bp_displayed_user_ domain();386 $bp->canonical_stack['base_url'] = bp_displayed_user_url(); 387 387 388 388 if ( bp_current_component() ) { -
trunk/src/bp-members/screens/change-avatar.php
r13220 r13443 86 86 87 87 bp_core_add_message( __( 'Your new profile photo was uploaded successfully.', 'buddypress' ) ); 88 bp_core_redirect( bp_displayed_user_ domain() );88 bp_core_redirect( bp_displayed_user_url() ); 89 89 } 90 90 } -
trunk/src/bp-messages/actions/bulk-delete.php
r13096 r13443 19 19 } 20 20 21 $thread_ids = $_POST['thread_ids']; 21 $thread_ids = $_POST['thread_ids']; 22 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 23 $redirect = bp_displayed_user_url( $path_chunks ); 22 24 23 25 if ( ! $thread_ids || ! messages_check_thread_access( $thread_ids ) ) { 24 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ));26 bp_core_redirect( $redirect ); 25 27 } else { 26 28 if ( ! check_admin_referer( 'messages_delete_thread' ) ) { … … 34 36 } 35 37 36 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ));38 bp_core_redirect( $redirect ); 37 39 } 38 40 } -
trunk/src/bp-messages/actions/bulk-manage-star.php
r13096 r13443 73 73 } 74 74 75 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 76 $redirect = bp_displayed_user_url( $path_chunks ); 77 75 78 // Redirect back to message box. 76 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');79 bp_core_redirect( $redirect ); 77 80 die(); 78 81 } -
trunk/src/bp-messages/actions/bulk-manage.php
r13096 r13443 22 22 } 23 23 24 $action = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : ''; 25 $nonce = ! empty( $_POST['messages_bulk_nonce'] ) ? $_POST['messages_bulk_nonce'] : ''; 26 $messages = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : ''; 27 $messages = wp_parse_id_list( $messages ); 24 $action = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : ''; 25 $nonce = ! empty( $_POST['messages_bulk_nonce'] ) ? $_POST['messages_bulk_nonce'] : ''; 26 $messages = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : ''; 27 $messages = wp_parse_id_list( $messages ); 28 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 29 $redirect = bp_displayed_user_url( $path_chunks ); 28 30 29 31 // Bail if no action or no IDs. 30 32 if ( ( ! in_array( $action, array( 'delete', 'read', 'unread' ), true ) ) || empty( $messages ) || empty( $nonce ) ) { 31 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');33 bp_core_redirect( $redirect ); 32 34 } 33 35 … … 41 43 if ( ! messages_check_thread_access( $message ) && ! bp_current_user_can( 'bp_moderate' ) ) { 42 44 bp_core_add_message( __( 'There was a problem managing your messages.', 'buddypress' ), 'error' ); 43 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');45 bp_core_redirect( $redirect ); 44 46 } 45 47 } … … 70 72 71 73 // Redirect back to message box. 72 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');74 bp_core_redirect( $redirect ); 73 75 } 74 76 add_action( 'bp_actions', 'bp_messages_action_bulk_manage' ); -
trunk/src/bp-messages/actions/delete.php
r13096 r13443 19 19 } 20 20 21 $thread_id = bp_action_variable( 1 ); 21 $thread_id = bp_action_variable( 1 ); 22 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 23 $redirect = bp_displayed_user_url( $path_chunks ); 22 24 23 25 if ( ! $thread_id || ! is_numeric( $thread_id ) || ! messages_check_thread_access( $thread_id ) ) { 24 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ));26 bp_core_redirect( $redirect ); 25 27 } else { 26 28 if ( ! check_admin_referer( 'messages_delete_thread' ) ) { … … 34 36 bp_core_add_message( __('Message deleted.', 'buddypress') ); 35 37 } 36 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ));38 bp_core_redirect( $redirect ); 37 39 } 38 40 } -
trunk/src/bp-messages/actions/exit.php
r13196 r13443 19 19 } 20 20 21 $thread_id = bp_action_variable( 1 ); 21 $thread_id = bp_action_variable( 1 ); 22 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 23 $redirect = bp_displayed_user_url( $path_chunks ); 22 24 23 25 if ( ! $thread_id || ! is_numeric( $thread_id ) || ! messages_check_thread_access( $thread_id ) ) { 24 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ));26 bp_core_redirect( $redirect ); 25 27 } else { 26 28 if ( ! check_admin_referer( 'bp_messages_exit_thread' ) ) { … … 35 37 } 36 38 37 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ));39 bp_core_redirect( $redirect ); 38 40 } 39 41 } -
trunk/src/bp-messages/actions/read.php
r13096 r13443 44 44 } 45 45 46 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 47 $redirect = bp_displayed_user_url( $path_chunks ); 48 46 49 // Redirect back to the message box. 47 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action());50 bp_core_redirect( $redirect ); 48 51 } 49 52 add_action( 'bp_actions', 'bp_messages_action_mark_read' ); -
trunk/src/bp-messages/actions/star.php
r13096 r13443 39 39 40 40 // Redirect back to previous screen. 41 $redirect = wp_get_referer() ? wp_get_referer() : bp_displayed_user_domain() . bp_get_messages_slug(); 41 $redirect = wp_get_referer(); 42 43 if ( ! $redirect ) { 44 $messages_slug = bp_get_messages_slug(); 45 $redirect = bp_displayed_user_url( 46 array( 47 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $messages_slug, $messages_slug ), 48 ) 49 ); 50 } 51 42 52 bp_core_redirect( $redirect ); 43 53 die(); -
trunk/src/bp-messages/actions/unread.php
r13096 r13443 44 44 } 45 45 46 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 47 $redirect = bp_displayed_user_url( $path_chunks ); 48 46 49 // Redirect back to the message box URL. 47 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action());50 bp_core_redirect( $redirect ); 48 51 } 49 52 add_action( 'bp_actions', 'bp_messages_action_mark_unread' ); -
trunk/src/bp-messages/actions/view.php
r13383 r13443 46 46 } 47 47 48 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' ); 48 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), 'view', $thread_id ) ); 49 $redirect = bp_displayed_user_url( $path_chunks ); 50 51 bp_core_redirect( $redirect ); 49 52 } 50 53 -
trunk/src/bp-messages/bp-messages-template.php
r13442 r13443 973 973 */ 974 974 function bp_get_messages_form_action() { 975 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action(), bp_action_variable( 0 ) ) ); 976 $url = bp_displayed_user_url( $path_chunks ); 975 977 976 978 /** … … 979 981 * @since 1.0.0 980 982 * 981 * @param string $ valueThe form action.982 */ 983 return apply_filters( 'bp_get_messages_form_action', trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' . bp_action_variable( 0 ) ));983 * @param string $url The form action. 984 */ 985 return apply_filters( 'bp_get_messages_form_action',$url ); 984 986 } 985 987 … … 2299 2301 */ 2300 2302 function bp_get_the_thread_delete_link() { 2303 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), 'inbox', 'delete', bp_get_the_thread_id() ) ); 2304 $url = wp_nonce_url( bp_displayed_user_url( $path_chunks ), 'messages_delete_thread' ); 2301 2305 2302 2306 /** … … 2305 2309 * @since 1.0.0 2306 2310 * 2307 * @param string $value URL for deleting the current thread. 2308 * @param string $value Text indicating action being executed. 2309 */ 2310 return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_messages_slug() . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) ); 2311 * @param string $url URL for deleting the current thread. 2312 */ 2313 return apply_filters( 'bp_get_message_thread_delete_link', $url ); 2311 2314 } 2312 2315 … … 2327 2330 */ 2328 2331 function bp_get_the_thread_exit_link() { 2332 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), 'inbox', 'exit', bp_get_the_thread_id() ) ); 2333 $url = wp_nonce_url( bp_displayed_user_url( $path_chunks ), 'bp_messages_exit_thread' ); 2329 2334 2330 2335 /** 2331 2336 * Filters the URL to exit the current thread. 2332 2337 * 2333 * @since 1.0.0 2334 * 2335 * @param string $value URL to exit the current thread. 2336 * @param string $value Text indicating action being executed. 2337 */ 2338 return apply_filters( 'bp_get_the_thread_exit_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_messages_slug() . '/inbox/exit/' . bp_get_the_thread_id(), 'bp_messages_exit_thread' ) ); 2338 * @since 10.0.0 2339 * 2340 * @param string $url URL to exit the current thread. 2341 */ 2342 return apply_filters( 'bp_get_the_thread_exit_link', $url ); 2339 2343 } 2340 2344 -
trunk/src/bp-settings/actions/capabilities.php
r13090 r13443 78 78 do_action( 'bp_settings_capabilities_after_save' ); 79 79 80 // Redirect to the root domain. 81 bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/' ); 80 $path_chunks = bp_members_get_path_chunks( array( bp_get_settings_slug(), 'capabilities' ) ); 81 $redirect = bp_displayed_user_url( $path_chunks ); 82 83 // Redirect to the settings capability page. 84 bp_core_redirect( $redirect ); 82 85 } 83 86 add_action( 'bp_actions', 'bp_settings_action_capabilities' ); -
trunk/src/bp-settings/actions/general.php
r13395 r13443 51 51 $feedback = array(); // array of strings for feedback. 52 52 $user_id = bp_displayed_user_id(); // The ID of the user being displayed. 53 $settings_slug = bp_get_settings_slug(); 54 $path_chunks = array( 55 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 56 ); 53 57 54 58 // Nonce check. … … 100 104 101 105 bp_update_user_meta( $user_id, 'pending_email_change', $pending_email ); 102 $verify_link = bp_displayed_user_domain() . bp_get_settings_slug() . '/?verify_email_change=' . $hash; 106 $verify_link = add_query_arg( 107 'verify_email_change', 108 $hash, 109 bp_displayed_user_url( $path_chunks ) 110 ); 103 111 104 112 // Send the verification email. … … 227 235 228 236 // Set the URL to redirect the user to. 229 $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ); 237 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_general', 'general' ); 238 $redirect_to = bp_displayed_user_url( $path_chunks ); 230 239 231 240 /** … … 262 271 } 263 272 264 $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() ); 273 $settings_slug = bp_get_settings_slug(); 274 $path_chunks = array( 275 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ) 276 ); 277 $redirect_to = bp_displayed_user_url( $path_chunks ); 265 278 266 279 // Email change is being verified. -
trunk/src/bp-settings/actions/notifications.php
r13090 r13443 54 54 do_action( 'bp_core_notification_settings_after_save' ); 55 55 56 bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications/' ); 56 $settings_slug = bp_get_settings_slug(); 57 $path_chunks = array( 58 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 59 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_notifications', 'notifications' ), 60 ); 61 62 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 57 63 } 58 64 add_action( 'bp_actions', 'bp_settings_action_notifications' ); -
trunk/src/bp-settings/bp-settings-template.php
r13090 r13443 81 81 } 82 82 83 $settings_slug = bp_get_settings_slug(); 84 $dismiss_url = wp_nonce_url( 85 add_query_arg( 86 'dismiss_email_change', 87 1, 88 bp_displayed_user_url( 89 array( 90 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 91 ) 92 ) 93 ), 94 'bp_dismiss_email_change' 95 ); 83 96 ?> 84 97 … … 98 111 __( 'Check your email (%1$s) for the verification link, or <a href="%2$s">cancel the pending change</a>.', 'buddypress' ), 99 112 '<code>' . esc_html( $pending_email['newemail'] ) . '</code>', 100 esc_url( wp_nonce_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/?dismiss_email_change=1', 'bp_dismiss_email_change' ))113 esc_url( $dismiss_url ) 101 114 ); 102 115 ?> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php
r12082 r13443 5 5 * @package BuddyPress 6 6 * @subpackage bp-legacy 7 * @version 3.0.07 * @version 12.0.0 8 8 */ 9 9 … … 52 52 do_action( 'bp_before_member_messages_threads' ); ?> 53 53 54 <form action="<?php echo bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ?>/bulk-manage/" method="post" id="messages-bulk-management">54 <form action="<?php bp_displayed_user_link( array( bp_get_messages_slug(), bp_current_action(), 'bulk-manage' ) ); ?>" method="post" id="messages-bulk-management"> 55 55 56 56 <table id="message-threads" class="messages-notices"> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php
r12082 r13443 5 5 * @package BuddyPress 6 6 * @subpackage bp-legacy 7 * @version 3.0.07 * @version 12.0.0 8 8 */ 9 9 … … 11 11 do_action( 'bp_before_member_settings_template' ); ?> 12 12 13 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/'; ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post">13 <form action="<?php bp_displayed_user_link( array( bp_get_settings_slug(), 'capabilities' ) ); ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post"> 14 14 15 15 <?php -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/data.php
r13327 r13443 5 5 * @package BuddyPress 6 6 * @subpackage bp-legacy 7 * @version 1 1.0.07 * @version 12.0.0 8 8 */ 9 9 … … 85 85 sprintf( 86 86 '<a href="%1$s">%2$s</a>', 87 esc_url( bp_displayed_user_ domain() . bp_get_settings_slug() . '/delete-account/'),87 esc_url( bp_displayed_user_url( array( bp_get_settings_slug(), 'delete-account' ) ) ), 88 88 esc_html__( 'Delete Account', 'buddypress' ) 89 89 ) -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php
r12082 r13443 25 25 </div> 26 26 27 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">27 <form action="<?php bp_displayed_user_link( array( bp_get_settings_slug(), 'delete-account' ) ); ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post"> 28 28 29 29 <?php -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/general.php
r12082 r13443 5 5 * @package BuddyPress 6 6 * @subpackage bp-legacy 7 * @version 3.0.07 * @version 12.0.0 8 8 */ 9 9 … … 16 16 ?></h2> 17 17 18 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/general'; ?>" method="post" class="standard-form" id="settings-form">18 <form action="<?php bp_displayed_user_link( array( bp_get_settings_slug(), 'general' ) ); ?>" method="post" class="standard-form" id="settings-form"> 19 19 20 <?php if ( ! is_super_admin() ) : ?>20 <?php if ( ! is_super_admin() ) : ?> 21 21 22 22 <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php
r12082 r13443 5 5 * @package BuddyPress 6 6 * @subpackage bp-legacy 7 * @version 3.0.07 * @version 12.0.0 8 8 */ 9 9 … … 16 16 ?></h2> 17 17 18 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications'; ?>" method="post" class="standard-form" id="settings-form">18 <form action="<?php bp_displayed_user_link( array( bp_get_settings_slug(), 'notifications' ) ); ?>" method="post" class="standard-form" id="settings-form"> 19 19 <p><?php _e( 'Send an email notice when:', 'buddypress' ); ?></p> 20 20 -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/profile.php
r12082 r13443 5 5 * @package BuddyPress 6 6 * @subpackage bp-legacy 7 * @version 3.0.07 * @version 12.0.0 8 8 */ 9 9 … … 20 20 ?></h2> 21 21 22 <form action="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/profile'); ?>" method="post" class="standard-form" id="settings-form">22 <form action="<?php bp_displayed_user_link( array( bp_get_settings_slug(), 'profile' ) ); ?>" method="post" class="standard-form" id="settings-form"> 23 23 24 24 <?php if ( bp_xprofile_get_settings_fields() ) : ?> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/capabilities.php
r12908 r13443 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 12.0.0 7 7 */ 8 8 … … 13 13 </h2> 14 14 15 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) . '/capabilities/'); ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post">15 <form action="<?php bp_displayed_user_link( array( bp_nouveau_get_component_slug( 'settings' ), 'capabilities' ) ); ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post"> 16 16 17 17 <label for="user-spammer"> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/data.php
r13327 r13443 4 4 * 5 5 * @since 3.1.0 6 * @version 1 1.0.06 * @version 12.0.0 7 7 */ 8 8 … … 78 78 sprintf( 79 79 '<a href="%1$s">%2$s</a>', 80 esc_url( bp_displayed_user_ domain() . bp_nouveau_get_component_slug( 'settings' ) . '/delete-account/'),80 esc_url( bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'settings' ), 'delete-account' ) ) ), 81 81 esc_html__( 'Delete Account', 'buddypress' ) 82 82 ) -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/delete-account.php
r12908 r13443 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 12.0.0 7 7 */ 8 8 … … 15 15 <?php bp_nouveau_user_feedback( 'member-delete-account' ); ?> 16 16 17 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) . '/delete-account'); ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">17 <form action="<?php bp_displayed_user_link( array( bp_nouveau_get_component_slug( 'settings' ), 'delete-account' ) ); ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post"> 18 18 19 19 <label id="delete-account-understand" class="warn" for="delete-account-understand"> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php
r12908 r13443 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 12.0.0 7 7 */ 8 8 … … 17 17 </p> 18 18 19 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) . '/general'); ?>" method="post" class="standard-form" id="your-profile">19 <form action="<?php bp_displayed_user_link( array( bp_nouveau_get_component_slug( 'settings' ), 'general' ) ); ?>" method="post" class="standard-form" id="your-profile"> 20 20 21 21 <?php if ( ! is_super_admin() ) : ?> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/group-invites.php
r12908 r13443 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 12.0.0 7 7 */ 8 8 ?> … … 21 21 22 22 23 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) . '/invites/'); ?>" name="account-group-invites-form" id="account-group-invites-form" class="standard-form" method="post">23 <form action="<?php bp_displayed_user_link( array( bp_nouveau_get_component_slug( 'settings' ), 'invites' ) ); ?>" name="account-group-invites-form" id="account-group-invites-form" class="standard-form" method="post"> 24 24 25 25 <label for="account-group-invites-preferences"> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/notifications.php
r12908 r13443 4 4 * 5 5 * @since 3.0.0 6 * @version 3.0.06 * @version 12.0.0 7 7 */ 8 8 … … 17 17 </p> 18 18 19 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) . '/notifications'); ?>" method="post" class="standard-form" id="settings-form">19 <form action="<?php bp_displayed_user_link( array( bp_nouveau_get_component_slug( 'settings' ), 'notifications' ) ); ?>" method="post" class="standard-form" id="settings-form"> 20 20 21 21 <?php bp_nouveau_member_email_notice_settings(); ?> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/profile.php
r12908 r13443 17 17 </p> 18 18 19 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) . '/profile/'); ?>" method="post" class="standard-form" id="settings-form">19 <form action="<?php bp_displayed_user_link( array( bp_nouveau_get_component_slug( 'settings' ), 'profile' ) ); ?>" method="post" class="standard-form" id="settings-form"> 20 20 21 21 <?php if ( bp_xprofile_get_settings_fields() ) : ?> -
trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php
r13442 r13443 503 503 } 504 504 505 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'settings' ) ) . 'invites/');505 bp_core_redirect( bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'settings' ), 'invites' ) ) ); 506 506 } 507 507 -
trunk/src/bp-templates/bp-nouveau/includes/template-tags.php
r13441 r13443 2259 2259 2260 2260 if ( bp_is_user() ) { 2261 $url = rawurlencode( bp_displayed_user_ domain() );2261 $url = rawurlencode( bp_displayed_user_url() ); 2262 2262 2263 2263 } elseif ( bp_is_group() ) { … … 2699 2699 2700 2700 if ( $retval ) { 2701 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/feed');2701 $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'feed' ) ); 2702 2702 } 2703 2703 … … 2706 2706 2707 2707 if ( $retval ) { 2708 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'friends' ) . '/feed');2708 $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), bp_nouveau_get_component_slug( 'friends' ), 'feed' ) ); 2709 2709 } 2710 2710 } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_nouveau_get_component_slug( 'groups' ) ) ) { … … 2712 2712 2713 2713 if ( $retval ) { 2714 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'groups' ) . '/feed');2714 $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), bp_nouveau_get_component_slug( 'groups' ), 'feed' ) ); 2715 2715 } 2716 2716 } elseif ( bp_activity_do_mentions() && bp_is_current_action( 'mentions' ) ) { … … 2718 2718 2719 2719 if ( $retval ) { 2720 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/mentions/feed');2720 $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'mentions', 'feed' ) ); 2721 2721 } 2722 2722 } elseif ( bp_activity_can_favorite() && bp_is_current_action( 'favorites' ) ) { … … 2724 2724 2725 2725 if ( $retval ) { 2726 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/favorites/feed');2726 $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'favorites', 'feed' ) ); 2727 2727 } 2728 2728 } -
trunk/src/bp-xprofile/bp-xprofile-template.php
r13393 r13443 390 390 391 391 // Build the form action URL. 392 $form_action = trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . $group->id ); 392 $profile_slug = bp_get_profile_slug(); 393 $path_chunks = array( 394 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 395 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ), 396 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), $group->id ), 397 ); 398 $form_action = bp_displayed_user_url( $path_chunks ); 393 399 394 400 /** … … 1074 1080 1075 1081 // Build the profile field group link. 1076 $link = trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . $groups[ $i ]->id ); 1082 $profile_slug = bp_get_profile_slug(); 1083 $path_chunks = array( 1084 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 1085 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ), 1086 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), $groups[ $i ]->id ), 1087 ); 1088 $link = bp_displayed_user_url( $path_chunks ); 1077 1089 1078 1090 // Add tab to end of tabs array. … … 1232 1244 */ 1233 1245 function bp_edit_profile_button() { 1246 $profile_slug = bp_get_profile_slug(); 1247 $path_chunks = array( 1248 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 1249 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ), 1250 ); 1251 1234 1252 bp_button( array( 1235 1253 'id' => 'edit_profile', … … 1237 1255 'must_be_logged_in' => true, 1238 1256 'block_self' => true, 1239 'link_href' => trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit'),1257 'link_href' => bp_displayed_user_url( $path_chunks ), 1240 1258 'link_class' => 'edit', 1241 1259 'link_text' => __( 'Edit Profile', 'buddypress' ), -
trunk/src/bp-xprofile/screens/edit.php
r13393 r13443 21 21 } 22 22 23 $profile_slug = bp_get_profile_slug(); 24 $path_chunks = array( 25 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 26 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ), 27 ); 28 29 23 30 // Make sure a group is set. 24 31 if ( ! bp_action_variable( 1 ) ) { 25 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/1' ) ); 32 $path_chunks['single_item_action_variables'] = array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), 1 ); 33 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 26 34 } 27 35 … … 43 51 // Check we have field ID's. 44 52 if ( empty( $_POST['field_ids'] ) ) { 45 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . bp_action_variable( 1 ) ) ); 53 $path_chunks['single_item_action_variables'] = array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), bp_action_variable( 1 ) ); 54 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 46 55 } 47 56 … … 156 165 157 166 // Redirect back to the edit screen to display the updates and message. 158 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . bp_action_variable( 1 ) ) ); 167 $path_chunks['single_item_action_variables'] = array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), bp_action_variable( 1 ) ); 168 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 159 169 } 160 170 } -
trunk/src/bp-xprofile/screens/settings-profile.php
r13393 r13443 111 111 112 112 // Redirect to the root domain. 113 bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/profile' ); 113 $settings_slug = bp_get_settings_slug(); 114 $path_chunks = array( 115 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 116 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_profile', 'profile' ), 117 ); 118 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 114 119 } 115 120 add_action( 'bp_actions', 'bp_xprofile_action_settings' );
Note: See TracChangeset
for help on using the changeset viewer.