Changeset 13436
- Timestamp:
- 03/15/2023 08:16:46 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r13395 r13436 3263 3263 $link = $activity_obj->primary_link; 3264 3264 } else { 3265 if ( 'activity_comment' == $activity_obj->type ) { 3266 $link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->item_id . '/#acomment-' . $activity_obj->id; 3265 $path_chunks = array( 3266 'component_id' => 'activity', 3267 'single_item_action' => 'p', 3268 'single_item_action_variables' => array( $activity_obj->id ), 3269 ); 3270 3271 if ( 'activity_comment' === $activity_obj->type ) { 3272 $path_chunks['single_item_action_variables'] = array( $activity_obj->item_id ); 3273 3274 $link = bp_rewrites_get_url( $path_chunks ) . '#acomment-' . $activity_obj->id; 3267 3275 } else { 3268 $link = bp_ get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->id . '/';3276 $link = bp_rewrites_get_url( $path_chunks ); 3269 3277 } 3270 3278 } -
trunk/src/bp-activity/bp-activity-template.php
r13433 r13436 87 87 */ 88 88 function bp_get_activity_directory_permalink() { 89 $url = bp_rewrites_get_url( 90 array( 91 'component_id' => 'activity', 92 ) 93 ); 89 94 90 95 /** … … 95 100 * @param string $url Permalink url for the activity directory. 96 101 */ 97 return apply_filters( 'bp_get_activity_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ));102 return apply_filters( 'bp_get_activity_directory_permalink', $url ); 98 103 } 99 104 … … 2393 2398 */ 2394 2399 function bp_get_activity_comment_delete_link() { 2395 $link = wp_nonce_url( trailingslashit( bp_get_activity_directory_permalink() . 'delete/' . bp_get_activity_comment_id() ) . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' ); 2400 $url = bp_rewrites_get_url( 2401 array( 2402 'component_id' => 'activity', 2403 'single_item_action' => 'delete', 2404 'single_item_action_variables' => array( bp_get_activity_comment_id() ), 2405 ) 2406 ); 2407 $link = wp_nonce_url( add_query_arg( 'cid', bp_get_activity_comment_id(), $url ), 'bp_activity_delete_link' ); 2396 2408 2397 2409 /** … … 2992 3004 } 2993 3005 2994 $url = trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activity_id ); 3006 $url = bp_rewrites_get_url( 3007 array( 3008 'component_id' => 'activity', 3009 'single_item_action' => 'delete', 3010 'single_item_action_variables' => array( $activity_id ), 3011 ) 3012 ); 2995 3013 2996 3014 // Determine if we're on a single activity page, and customize accordingly. … … 3870 3888 */ 3871 3889 function bp_get_sitewide_activity_feed_link() { 3890 $url = bp_rewrites_get_url( 3891 array( 3892 'component_id' => 'activity', 3893 'single_item_action' => 'feed', 3894 ) 3895 ); 3872 3896 3873 3897 /** … … 3876 3900 * @since 1.0.0 3877 3901 * 3878 * @param string $ valueThe feed link for sitewide activity.3879 */ 3880 return apply_filters( 'bp_get_sitewide_activity_feed_link', bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed/');3902 * @param string $url The feed link for sitewide activity. 3903 */ 3904 return apply_filters( 'bp_get_sitewide_activity_feed_link', $url ); 3881 3905 } 3882 3906 -
trunk/src/bp-activity/classes/class-bp-activity-oembed-extension.php
r13433 r13436 86 86 protected function validate_url_to_item_id( $url ) { 87 87 if ( bp_core_enable_root_profiles() ) { 88 $domain = bp_get_root_ domain();88 $domain = bp_get_root_url(); 89 89 } else { 90 90 $domain = bp_get_members_directory_permalink(); … … 96 96 } 97 97 98 // Check for activity slug. 99 if ( false === strpos( $url, '/' . bp_get_activity_slug() . '/' ) ) { 100 return false; 101 } 102 103 // Do more checks. 104 $url = trim( untrailingslashit( $url ) ); 105 106 // Grab the activity ID. 107 $activity_id = (int) substr( 108 $url, 109 strrpos( $url, '/' ) + 1 110 ); 98 if ( ! bp_has_pretty_urls() ) { 99 $url_query = wp_parse_url( $url, PHP_URL_QUERY ); 100 101 if ( $url_query ) { 102 $query_vars = bp_parse_args( $url_query, array() ); 103 104 if ( isset( $query_vars['bp_member_action'] ) ) { 105 $activity_id = (int) $query_vars['bp_member_action']; 106 } 107 } 108 109 } elseif ( false !== strpos( $url, '/' . bp_get_activity_slug() . '/' ) ) { 110 // Do more checks. 111 $url = trim( untrailingslashit( $url ) ); 112 113 // Grab the activity ID. 114 $activity_id = (int) substr( 115 $url, 116 strrpos( $url, '/' ) + 1 117 ); 118 } 111 119 112 120 if ( ! empty( $activity_id ) ) { -
trunk/src/bp-activity/classes/class-bp-akismet.php
r12694 r13436 192 192 */ 193 193 public function add_activity_spam_button() { 194 if ( !bp_activity_user_can_mark_spam() ) 195 return; 194 if ( ! bp_activity_user_can_mark_spam() ) { 195 return; 196 } 196 197 197 198 // By default, only handle activity updates and activity comments. 198 if ( !in_array( bp_get_activity_type(), BP_Akismet::get_activity_types() ) ) 199 return; 199 if ( ! in_array( bp_get_activity_type(), BP_Akismet::get_activity_types(), true ) ) { 200 return; 201 } 202 203 $spam_link = bp_rewrites_get_url( 204 array( 205 'component_id' => 'activity', 206 'single_item_action' => 'spam', 207 'single_item_action_variables' => array( bp_get_activity_id() ), 208 ) 209 ); 200 210 201 211 bp_button( … … 205 215 'id' => 'activity_make_spam_' . bp_get_activity_id(), 206 216 'link_class' => 'bp-secondary-action spam-activity confirm button item-button', 207 'link_href' => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_id() . '/', 'bp_activity_akismet_spam_' . bp_get_activity_id() ),217 'link_href' => wp_nonce_url( $spam_link, 'bp_activity_akismet_spam_' . bp_get_activity_id() ), 208 218 'link_text' => __( 'Spam', 'buddypress' ), 209 219 'wrapper' => false, … … 220 230 */ 221 231 public function add_activity_comment_spam_button() { 222 if ( !bp_activity_user_can_mark_spam() ) 223 return; 232 if ( ! bp_activity_user_can_mark_spam() ) { 233 return; 234 } 224 235 225 236 // By default, only handle activity updates and activity comments. 226 237 $current_comment = bp_activity_current_comment(); 227 if ( empty( $current_comment ) || !in_array( $current_comment->type, BP_Akismet::get_activity_types() ) ) 228 return; 238 if ( empty( $current_comment ) || ! in_array( $current_comment->type, BP_Akismet::get_activity_types(), true ) ) { 239 return; 240 } 241 242 $spam_link = add_query_arg( 243 'cid', 244 bp_get_activity_comment_id(), 245 bp_rewrites_get_url( 246 array( 247 'component_id' => 'activity', 248 'single_item_action' => 'spam', 249 'single_item_action_variables' => array( bp_get_activity_comment_id() ), 250 ) 251 ) 252 ); 229 253 230 254 bp_button( … … 234 258 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), 235 259 'link_class' => 'bp-secondary-action spam-activity-comment confirm', 236 'link_href' => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id() ),260 'link_href' => wp_nonce_url( $spam_link, 'bp_activity_akismet_spam_' . bp_get_activity_comment_id() ), 237 261 'link_text' => __( 'Spam', 'buddypress' ), 238 262 'wrapper' => false, -
trunk/src/bp-activity/screens/permalink.php
r13433 r13436 17 17 function bp_activity_action_permalink_router() { 18 18 // Not viewing activity. 19 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) ) 19 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) ) { 20 20 return false; 21 } 21 22 22 23 // No activity to display. 23 if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) ) 24 if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) ) { 24 25 return false; 26 } 25 27 26 28 // Get the activity details. … … 78 80 */ 79 81 if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) { 80 bp_core_redirect( bp_get_root_ domain() );82 bp_core_redirect( bp_get_root_url() ); 81 83 } 82 84 -
trunk/src/bp-blogs/bp-blogs-blocks.php
r13108 r13436 33 33 $classnames = 'widget_bp_blogs_widget buddypress widget'; 34 34 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) ); 35 $blogs_directory_link = bp_get_blogs_directory_ permalink();35 $blogs_directory_link = bp_get_blogs_directory_url(); 36 36 $max_posts = (int) $block_args['maxPosts']; 37 37 $no_posts = __( 'Sorry, there were no posts found.', 'buddypress' ); -
trunk/src/bp-blogs/bp-blogs-filters.php
r13405 r13436 30 30 */ 31 31 function bp_blogs_creation_location( $url ) { 32 $bp_url = bp_get_blogs_directory_url( 33 array( 34 'create_single_item' => 1, 35 ) 36 ); 32 37 33 38 /** … … 36 41 * @since 1.6.0 37 42 * 38 * @param string $ permalinkURL for the 'Create a new site' signup page.39 * @param string $url 43 * @param string $bp_url URL for the 'Create a new site' signup page. 44 * @param string $url The original URL (points to wp-signup.php by default). 40 45 */ 41 return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_blogs_directory_permalink() . 'create' ), $url );46 return apply_filters( 'bp_blogs_creation_location', $bp_url, $url ); 42 47 } 43 48 add_filter( 'wp_signup_location', 'bp_blogs_creation_location' ); -
trunk/src/bp-blogs/bp-blogs-template.php
r13409 r13436 68 68 69 69 /** 70 * Output blog directory permalink. 71 * 72 * @since 1.5.0 73 * 74 */ 75 function bp_blogs_directory_permalink() { 76 echo esc_url( bp_get_blogs_directory_permalink() ); 77 } 78 /** 79 * Return blog directory permalink. 80 * 81 * @since 1.5.0 82 * 83 * 84 * @return string The URL of the Blogs directory. 85 */ 86 function bp_get_blogs_directory_permalink() { 87 88 /** 89 * Filters the blog directory permalink. 90 * 91 * @since 1.5.0 92 * 93 * @param string $value Permalink URL for the blog directory. 94 */ 95 return apply_filters( 'bp_get_blogs_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) ); 96 } 70 * Output Blogs directory's URL. 71 * 72 * @since 12.0.0 73 */ 74 function bp_blogs_directory_url() { 75 echo esc_url( bp_get_blogs_directory_url() ); 76 } 77 78 /** 79 * Returns the Blogs directory's URL. 80 * 81 * @since 12.0.0 82 * 83 * @param array $path_chunks { 84 * An array of arguments. Optional. 85 * 86 * @type int $create_single_item `1` to get the Blogs create link. 87 * } 88 * @return string The URL built for the BP Rewrites URL parser. 89 */ 90 function bp_get_blogs_directory_url( $path_chunks = array() ) { 91 $supported_chunks = array_fill_keys( array( 'create_single_item' ), true ); 92 93 $path_chunks = bp_parse_args( 94 array_intersect_key( $path_chunks, $supported_chunks ), 95 array( 96 'component_id' => 'blogs' 97 ) 98 ); 99 100 $url = bp_rewrites_get_url( $path_chunks ); 101 102 /** 103 * Filters the Blogs directory's URL. 104 * 105 * @since 12.0.0 106 * 107 * @param string $url The Blogs directory's URL. 108 * @param array $path_chunks { 109 * An array of arguments. Optional. 110 * 111 * @type int $create_single_item `1` to get the Blogs create link. 112 * } 113 */ 114 return apply_filters( 'bp_get_blogs_directory_url', $url, $path_chunks ); 115 } 97 116 98 117 /** … … 474 493 global $blogs_template; 475 494 476 if ( empty( $blogs_template->blog->domain ) ) 477 $permalink = bp_get_root_domain() . $blogs_template->blog->path; 478 else { 495 if ( ! empty( $blogs_template->blog->domain ) ) { 496 $permalink = get_site_url( $blogs_template->blog->blog_id ); 497 498 } else { 479 499 $protocol = 'http://'; 480 if ( is_ssl() ) 500 if ( is_ssl() ) { 481 501 $protocol = 'https://'; 502 } 482 503 483 504 $permalink = $protocol . $blogs_template->blog->domain . $blogs_template->blog->path; … … 1349 1370 } 1350 1371 1372 $url = bp_get_blogs_directory_url( 1373 array( 1374 'create_single_item' => 1, 1375 ) 1376 ); 1377 1351 1378 /** 1352 1379 * Filters "Create a Site" links for users viewing their own profiles. … … 1354 1381 * @since 1.0.0 1355 1382 * 1356 * @param string $ valueHTML link for creating a site.1357 */ 1358 echo apply_filters( 'bp_create_blog_link', '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ). '">' . __( 'Create a Site', 'buddypress' ) . '</a>' );1383 * @param string $url HTML link for creating a site. 1384 */ 1385 echo apply_filters( 'bp_create_blog_link', '<a href="' . $url . '">' . __( 'Create a Site', 'buddypress' ) . '</a>' ); 1359 1386 } 1360 1387 … … 1460 1487 } 1461 1488 1489 $url = bp_get_blogs_directory_url( 1490 array( 1491 'create_single_item' => 1, 1492 ) 1493 ); 1494 1462 1495 $button_args = array( 1463 1496 'id' => 'create_blog', … … 1465 1498 'link_text' => __( 'Create a Site', 'buddypress' ), 1466 1499 'link_class' => 'blog-create no-ajax', 1467 'link_href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),1500 'link_href' => $url, 1468 1501 'wrapper' => false, 1469 1502 'block_self' => false, -
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r13432 r13436 82 82 'has_directory' => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site. 83 83 'rewrite_ids' => array( 84 'directory' => 'blogs', 85 'single_item_action' => 'blogs_action', 86 'single_item_action_variables' => 'blogs_action_variables', 84 'directory' => 'blogs', 85 'create_single_item' => 'blog_create', 87 86 ), 88 87 'directory_title' => isset( $bp->pages->blogs->title ) ? $bp->pages->blogs->title : $default_directory_title, … … 312 311 // Create a Site. 313 312 if ( bp_blog_signup_enabled() ) { 313 $url = bp_get_blogs_directory_url( 314 array( 315 'create_single_item' => 1, 316 ) 317 ); 318 314 319 $wp_admin_nav[] = array( 315 320 'parent' => 'my-account-' . $this->id, 316 321 'id' => 'my-account-' . $this->id . '-create', 317 322 'title' => __( 'Create a Site', 'buddypress' ), 318 'href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),323 'href' => $url, 319 324 'position' => 99 320 325 ); … … 371 376 372 377 parent::setup_cache_groups(); 378 } 379 380 /** 381 * Add the Blog Create rewrite tags. 382 * 383 * @since 12.0.0 384 * 385 * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for 386 * description. 387 */ 388 public function add_rewrite_tags( $rewrite_tags = array() ) { 389 $rewrite_tags = array( 390 'create_single_item' => '([1]{1,})', 391 ); 392 393 parent::add_rewrite_tags( $rewrite_tags ); 394 } 395 396 /** 397 * Add the Registration and Activation rewrite rules. 398 * 399 * @since 12.0.0 400 * 401 * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for 402 * description. 403 */ 404 public function add_rewrite_rules( $rewrite_rules = array() ) { 405 $create_slug = bp_rewrites_get_slug( 'blogs', 'blog_create', 'create' ); 406 407 $rewrite_rules = array( 408 'create_single_item' => array( 409 'regex' => $this->root_slug . '/' . $create_slug . '/?$', 410 'order' => 50, 411 'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['create_single_item'] . '=1', 412 ), 413 ); 414 415 parent::add_rewrite_rules( $rewrite_rules ); 373 416 } 374 417 -
trunk/src/bp-blogs/classes/class-bp-blogs-recent-posts-widget.php
r13108 r13436 50 50 51 51 if ( ! empty( $instance['link_title'] ) ) { 52 $title = '<a href="' . bp_get_blogs_directory_ permalink() . '">' . esc_html( $title ) . '</a>';52 $title = '<a href="' . bp_get_blogs_directory_url() . '">' . esc_html( $title ) . '</a>'; 53 53 } 54 54 -
trunk/src/bp-core/bp-core-avatars.php
r13312 r13436 201 201 * provided, the function will infer it: for users, by getting the 202 202 * user's email from the database, for groups/blogs, by concatenating 203 * "{$item_id}-{$object}@{bp_get_ root_domain()}". The user query adds203 * "{$item_id}-{$object}@{bp_get_domain()}". The user query adds 204 204 * overhead, so it's recommended that wrapper functions provide a 205 205 * value for 'email' when querying user IDs. Default: false. … … 642 642 $params['email'] = bp_core_get_user_email( $params['item_id'] ); 643 643 } elseif ( 'group' == $params['object'] || 'blog' == $params['object'] ) { 644 $params['email'] = $params['item_id'] . '-' . $params['object'] . '@' . bp_get_ root_domain();644 $params['email'] = $params['item_id'] . '-' . $params['object'] . '@' . bp_get_domain(); 645 645 } 646 646 } -
trunk/src/bp-core/bp-core-blocks.php
r13144 r13436 235 235 $content .= sprintf( 236 236 '<p class="bp-login-widget-pwd-link"><a href="%1$s">%2$s</a></p>', 237 esc_url( wp_lostpassword_url( bp_get_root_ domain() ) ),237 esc_url( wp_lostpassword_url( bp_get_root_url() ) ), 238 238 esc_html__( 'Lost your password?', 'buddypress' ) 239 239 ); -
trunk/src/bp-core/bp-core-buddybar.php
r13108 r13436 780 780 } else { 781 781 $message = __( 'You do not have access to this page.', 'buddypress' ); 782 $redirect_to = bp_get_root_ domain();782 $redirect_to = bp_get_root_url(); 783 783 } 784 784 -
trunk/src/bp-core/bp-core-catchuri.php
r13433 r13436 632 632 * logging in. Default: the URL originally requested. 633 633 * @type string $root The root URL of the site, used in case of error or mode 1 redirects. 634 * Default: the value of {@link bp_get_root_ domain()}.634 * Default: the value of {@link bp_get_root_url()}. 635 635 * @type string $message An error message to display to the user on the log-in page. 636 636 * Default: "You must log in to access the page you requested." … … 647 647 'mode' => 2, // 1 = $root, 2 = wp-login.php. 648 648 'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in. 649 'root' => bp_get_root_ domain(),// the landing page you get redirected to when a user doesn't have access.649 'root' => bp_get_root_url(), // the landing page you get redirected to when a user doesn't have access. 650 650 'message' => __( 'You must log in to access the page you requested.', 'buddypress' ) 651 651 ); … … 908 908 */ 909 909 if ( false !== $front_page_component && bp_is_current_component( $front_page_component ) && ! bp_current_action() && ! bp_get_current_member_type() ) { 910 $bp->canonical_stack['canonical_url'] = trailingslashit( bp_get_root_domain());910 $bp->canonical_stack['canonical_url'] = bp_get_root_url(); 911 911 912 912 // Except when the front page is set to the registration page -
trunk/src/bp-core/bp-core-filters.php
r13433 r13436 384 384 * @param string $value URL to redirect to. 385 385 */ 386 return apply_filters( 'bp_core_login_redirect_to', bp_get_root_ domain() );386 return apply_filters( 'bp_core_login_redirect_to', bp_get_root_url() ); 387 387 } 388 388 add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 ); … … 1206 1206 function bp_email_set_default_tokens( $tokens, $property_name, $transform, $email ) { 1207 1207 $tokens['site.admin-email'] = bp_get_option( 'admin_email' ); 1208 $tokens['site.url'] = bp_get_root_ domain();1208 $tokens['site.url'] = bp_get_root_url(); 1209 1209 $tokens['email.subject'] = $email->get_subject(); 1210 1210 … … 1236 1236 1237 1237 if ( bp_is_active( 'settings' ) && empty( $tokens['unsubscribe'] ) ) { 1238 $tokens['unsubscribe'] = esc_url( sprintf( 1239 '%s%s/notifications/', 1240 bp_members_get_user_url( $user_obj->ID ), 1241 bp_get_settings_slug() 1242 ) ); 1238 $tokens['unsubscribe'] = esc_url( 1239 bp_members_get_user_url( 1240 $user_obj->ID, 1241 array( 1242 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ), 1243 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ), 1244 ) 1245 ) 1246 ); 1243 1247 } 1244 1248 } -
trunk/src/bp-core/bp-core-functions.php
r13433 r13436 1116 1116 function bp_core_get_root_domain() { 1117 1117 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_rewrites_get_root_url()' ); 1118 1119 1118 $domain = bp_rewrites_get_root_url(); 1120 1119 … … 1145 1144 // have a valid URL. 1146 1145 if ( empty( $location ) ) { 1147 $location = bp_get_root_ domain();1146 $location = bp_get_root_url(); 1148 1147 } 1149 1148 … … 2530 2529 2531 2530 if ( empty( $_POST['search-terms'] ) ) { 2532 bp_core_redirect( bp_get_root_ domain() );2531 bp_core_redirect( bp_get_root_url() ); 2533 2532 return; 2534 2533 } … … 2574 2573 2575 2574 if ( empty( $slug ) && 'posts' != $search_which ) { 2576 bp_core_redirect( bp_get_root_ domain() );2575 bp_core_redirect( bp_get_root_url() ); 2577 2576 return; 2578 2577 } … … 4368 4367 } else { 4369 4368 if ( bp_is_active( 'settings' ) ) { 4370 $redirect_to = sprintf( 4371 '%s%s/notifications/', 4372 bp_members_get_user_url( $raw_user_id ), 4373 bp_get_settings_slug() 4369 $redirect_to = bp_members_get_user_url( 4370 $raw_user_id, 4371 array( 4372 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ), 4373 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ), 4374 ) 4374 4375 ); 4375 4376 } else { -
trunk/src/bp-core/bp-core-rewrites.php
r13433 r13436 172 172 $create_slug = 'create'; 173 173 if ( 'groups' === $component->id ) { 174 $create_slug = bp_rewrites_get_slug( 'groups', 'bp_group_create', 'create' ); 174 $create_slug = bp_rewrites_get_slug( 'groups', 'group_create', 'create' ); 175 } elseif ( 'blogs' === $component->id ) { 176 $create_slug = bp_rewrites_get_slug( 'blogs', 'blog_create', 'create' ); 175 177 } 176 178 -
trunk/src/bp-core/bp-core-template.php
r13432 r13436 518 518 */ 519 519 function bp_search_form_action() { 520 $url = bp_rewrites_get_url( 521 array( 522 'component_id' => bp_get_search_slug(), 523 ) 524 ); 520 525 521 526 /** … … 524 529 * @since 1.0.0 525 530 * 526 * @param string $ valueSearch form action url.527 */ 528 return apply_filters( 'bp_search_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_search_slug() ));531 * @param string $url Search form action url. 532 */ 533 return apply_filters( 'bp_search_form_action', $url ); 529 534 } 530 535 … … 1397 1402 */ 1398 1403 return apply_filters( 'bp_action_variable', $action_variable, $position ); 1404 } 1405 1406 /** 1407 * Returns the BP root blog's domain name. 1408 * 1409 * @since 12.0.0 1410 * 1411 * @return string The BP root blog's domain name. 1412 */ 1413 function bp_get_domain() { 1414 return wp_parse_url( bp_get_root_url(), PHP_URL_HOST ); 1399 1415 } 1400 1416 -
trunk/src/bp-core/deprecated/12.0.php
r13433 r13436 242 242 return apply_filters_deprecated( 'bp_core_get_user_domain', array( $domain, $user_id, $user_nicename, $user_login), '12.0.0', 'bp_members_get_user_url' ); 243 243 } 244 245 /** 246 * Get the link for the logged-in user's profile. 247 * 248 * @since 1.0.0 249 * @deprecated 12.0.0 250 * 251 * @return string 252 */ 253 function bp_get_loggedin_user_link() { 254 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_loggedin_user_url()' ); 255 $url = bp_loggedin_user_url(); 256 257 /** 258 * Filters the link for the logged-in user's profile. 259 * 260 * @since 1.2.4 261 * @deprecated 12.0.0 262 * 263 * @param string $url Link for the logged-in user's profile. 264 */ 265 return apply_filters_deprecated( 'bp_get_loggedin_user_link', array( $url ), '12.0.0', 'bp_loggedin_user_url' ); 266 } 267 268 /** 269 * Get the link for the displayed user's profile. 270 * 271 * @since 1.0.0 272 * @deprecated 12.0.0 273 * 274 * @return string 275 */ 276 function bp_get_displayed_user_link() { 277 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_displayed_user_url()' ); 278 $url = bp_displayed_user_url(); 279 280 /** 281 * Filters the link for the displayed user's profile. 282 * 283 * @since 1.2.4 284 * @deprecated 12.0.0 285 * 286 * @param string $url Link for the displayed user's profile. 287 */ 288 return apply_filters_deprecated( 'bp_get_displayed_user_link', array( $url ), '12.0.0', 'bp_displayed_user_url' ); 289 } 290 291 /** 292 * Alias of {@link bp_displayed_user_domain()}. 293 * 294 * @deprecated 12.0.0 295 */ 296 function bp_user_link() { 297 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_displayed_user_url()' ); 298 bp_displayed_user_url(); 299 } 300 301 /** 302 * Output blog directory permalink. 303 * 304 * @since 1.5.0 305 * @deprecated 12.0.0 306 */ 307 function bp_blogs_directory_permalink() { 308 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_blogs_directory_url()' ); 309 bp_blogs_directory_url(); 310 } 311 312 /** 313 * Return blog directory permalink. 314 * 315 * @since 1.5.0 316 * @deprecated 12.0.0 317 * 318 * @return string The URL of the Blogs directory. 319 */ 320 function bp_get_blogs_directory_permalink() { 321 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_get_blogs_directory_url()' ); 322 $url = bp_get_blogs_directory_url(); 323 324 /** 325 * Filters the blog directory permalink. 326 * 327 * @since 1.5.0 328 * @deprecated 12.0.0 329 * 330 * @param string $url Permalink URL for the blog directory. 331 */ 332 return apply_filters_deprecated( 'bp_get_blogs_directory_permalink', array( $url ), '12.0.0', 'bp_get_blogs_directory_url' ); 333 } -
trunk/src/bp-groups/bp-groups-notifications.php
r13433 r13436 341 341 array( 342 342 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_groups', bp_get_groups_slug() ), 343 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_groups_invites', 'invites' ), 343 344 ) 344 345 ); … … 359 360 } 360 361 361 $args 362 $args = array( 362 363 'tokens' => array( 363 364 'group' => $group, … … 367 368 'inviter.url' => bp_members_get_user_url( $inviter_user_id ), 368 369 'inviter.id' => $inviter_user_id, 369 'invites.url' => esc_url( $invited_link . '/invites/'),370 'invites.url' => esc_url( $invited_link ), 370 371 'invite.message' => $invite_message, 371 372 'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ), -
trunk/src/bp-groups/bp-groups-template.php
r13433 r13436 96 96 97 97 /** 98 * Output Groups directory's URL. 99 * 100 * @since 12.0.0 101 */ 102 function bp_groups_directory_url() { 103 echo esc_url( bp_get_groups_directory_url() ); 104 } 105 106 /** 107 * Returns the Groups directory's URL. 108 * 109 * @since 12.0.0 110 * 111 * @param array $path_chunks { 112 * An array of arguments. Optional. 113 * 114 * @type int $create_single_item `1` to get the create a group URL. 115 * @type array $directory_type The group type slug. 116 * } 117 * @return string The URL built for the BP Rewrites URL parser. 118 */ 119 function bp_get_groups_directory_url( $path_chunks = array() ) { 120 $supported_chunks = array_fill_keys( array( 'create_single_item', 'directory_type' ), true ); 121 122 $path_chunks = bp_parse_args( 123 array_intersect_key( $path_chunks, $supported_chunks ), 124 array( 125 'component_id' => 'groups' 126 ) 127 ); 128 129 $url = bp_rewrites_get_url( $path_chunks ); 130 131 /** 132 * Filters the Groups directory's URL. 133 * 134 * @since 12.0.0 135 * 136 * @param string $url The Groups directory's URL. 137 * @param array $path_chunks { 138 * An array of arguments. Optional. 139 * 140 * @type int $create_single_item `1` to get the create a group URL. 141 * @type array $directory_type The group type slug. 142 * } 143 */ 144 return apply_filters( 'bp_get_groups_directory_url', $url, $path_chunks ); 145 } 146 147 /** 98 148 * Output group directory permalink. 99 149 * 100 150 * @since 1.5.0 151 * @deprecated 12.0.0 101 152 */ 102 153 function bp_groups_directory_permalink() { 103 echo esc_url( bp_get_groups_directory_permalink() ); 154 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_groups_directory_url()' ); 155 bp_groups_directory_url(); 104 156 } 105 157 /** … … 107 159 * 108 160 * @since 1.5.0 161 * @deprecated 12.0.0 109 162 * 110 163 * @return string 111 164 */ 112 165 function bp_get_groups_directory_permalink() { 166 /* 167 * This function is used at many places and we need to review all this 168 * places during the 12.0 development cycle. Using BP Rewrites means we 169 * cannot concatenate URL chunks to build our URL anymore. We now need 170 * to use `bp_get_groups_directory_url( $array )` and make sure to use 171 * the right arguments inside this `$array`. Morevover as this function 172 * is also used to build a single group URL, we need to create a new 173 * function to create single group URLs using BP Rewrites. 174 * 175 * @todo Once every link reviewed, we'll be able to remove this check 176 * and let PHPUnit tell us the one we forgot, eventually! 177 */ 178 if ( ! buddypress()->is_phpunit_running ) { 179 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_get_groups_directory_url()' ); 180 } 181 182 $url = bp_get_groups_directory_url(); 113 183 114 184 /** … … 116 186 * 117 187 * @since 1.5.0 118 * 119 * @param string $value Permalink for the group directory. 120 */ 121 return apply_filters( 'bp_get_groups_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) ); 188 * @deprecated 12.0.0 189 * 190 * @param string $url Permalink for the group directory. 191 */ 192 return apply_filters_deprecated( 'bp_get_groups_directory_permalink', array( $url ), '12.0.0', 'bp_get_groups_directory_url' ); 122 193 } 123 194 -
trunk/src/bp-members/bp-members-filters.php
r13433 r13436 239 239 sprintf( 240 240 '<a href="%1$s">%2$s</a>', 241 esc_url( wp_login_url( bp_get_root_ domain() ) ),241 esc_url( wp_login_url( bp_get_root_url() ) ), 242 242 esc_html__( 'log in', 'buddypress' ) 243 243 ) … … 311 311 sprintf( 312 312 '<a href="%1$s">%2$s</a>', 313 esc_url( wp_login_url( bp_get_root_ domain() ) ),313 esc_url( wp_login_url( bp_get_root_url() ) ), 314 314 esc_html__( 'log in', 'buddypress' ) 315 315 ), 316 316 sprintf( 317 317 '<a href="%1$s">%2$s</a>', 318 esc_url( wp_lostpassword_url( bp_get_root_ domain() ) ),318 esc_url( wp_lostpassword_url( bp_get_root_url() ) ), 319 319 esc_html__( 'reset it', 'buddypress' ) 320 320 ) -
trunk/src/bp-members/bp-members-functions.php
r13433 r13436 145 145 * 146 146 * @param integer $user_id The user ID. 147 * @param array $ action{147 * @param array $path_chunks { 148 148 * An array of arguments. Optional. 149 149 * … … 178 178 * Filters the domain for the passed user. 179 179 * 180 * @since 1.0.1181 * @deprecated 12.0.0182 *183 * @param string $domain Domain for the passed user.184 * @param int $user_id ID of the passed user.185 * @param string $user_nicename User nicename of the passed user.186 * @param string $user_login User login of the passed user.187 */188 $url = apply_filters_deprecated( 'bp_core_get_user_domain', array( $url, $user_id, false, false ), '12.0.0', 'bp_members_get_user_url' );189 190 /**191 * Filters the domain for the passed user.192 *193 180 * @since 12.0.0 194 181 * … … 327 314 } 328 315 } 329 330 /**331 * Filters the username based on originally provided user ID.332 *333 * @since 1.0.1334 * @deprecated 12.0.0335 *336 * @param string $slug Username determined by user ID.337 */338 $slug = apply_filters_deprecated( 'bp_core_get_username', array( $slug ), '12.0.0', 'bp_members_get_user_slug' );339 316 340 317 /** … … 2547 2524 if ( $is_site_creation ) { 2548 2525 if ( bp_is_active( 'blogs' ) ) { 2549 $redirect_to = trailingslashit( bp_get_blogs_directory_permalink() . 'create' ); 2526 $url = bp_get_blogs_directory_url( 2527 array( 2528 'create_single_item' => 1, 2529 ) 2530 ); 2531 2532 $redirect_to = trailingslashit( $url ); 2550 2533 } else { 2551 2534 // Perform no redirect in this case. -
trunk/src/bp-members/bp-members-template.php
r13433 r13436 141 141 */ 142 142 function bp_get_members_directory_permalink() { 143 $url = bp_rewrites_get_url( 144 array( 145 'component_id' => 'members', 146 ) 147 ); 143 148 144 149 /** … … 147 152 * @since 1.5.0 148 153 * 149 * @param string $ valueMembers directory permalink.150 */ 151 return apply_filters( 'bp_get_members_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ));154 * @param string $url Members directory permalink. 155 */ 156 return apply_filters( 'bp_get_members_directory_permalink', $url ); 152 157 } 153 158 … … 186 191 } 187 192 193 $url = bp_rewrites_get_url( 194 array( 195 'component_id' => 'members', 196 'directory_type' => $type->directory_slug, 197 ) 198 ); 199 188 200 /** 189 201 * Filters the member type directory permalink. … … 191 203 * @since 2.5.0 192 204 * 193 * @param string $ valueMember type directory permalink.205 * @param string $url Member type directory permalink. 194 206 * @param object $type Member type object. 195 207 * @param string $member_type Member type name, as passed to the function. 196 208 */ 197 return apply_filters( 'bp_get_member_type_directory_permalink', trailingslashit( bp_get_members_directory_permalink() . bp_get_members_member_type_base() . '/' . $type->directory_slug ), $type, $member_type );209 return apply_filters( 'bp_get_member_type_directory_permalink', $url, $type, $member_type ); 198 210 } 199 211 … … 1458 1470 1459 1471 // Always add a log out list item to the end of the navigation. 1460 $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_ domain() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';1472 $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>'; 1461 1473 1462 1474 echo apply_filters( 'bp_logout_nav_link', $logout_link ); … … 1852 1864 1853 1865 /** 1854 * Output the link for the logged-in user's profile.1855 *1856 * @since 1.2.41857 */1858 function bp_loggedin_user_link() {1859 echo esc_url( bp_get_loggedin_user_link() );1860 }1861 /**1862 * Get the link for the logged-in user's profile.1863 *1864 * @since 1.0.01865 *1866 * @return string1867 */1868 function bp_get_loggedin_user_link() {1869 1870 /**1871 * Filters the link for the logged-in user's profile.1872 *1873 * @since 1.2.41874 *1875 * @param string $value Link for the logged-in user's profile.1876 */1877 return apply_filters( 'bp_get_loggedin_user_link', bp_loggedin_user_domain() );1878 }1879 1880 /**1881 * Output the link for the displayed user's profile.1882 *1883 * @since 1.2.41884 */1885 function bp_displayed_user_link() {1886 echo esc_url( bp_get_displayed_user_link() );1887 }1888 /**1889 * Get the link for the displayed user's profile.1890 *1891 * @since 1.0.01892 *1893 * @return string1894 */1895 function bp_get_displayed_user_link() {1896 1897 /**1898 * Filters the link for the displayed user's profile.1899 *1900 * @since 1.2.41901 *1902 * @param string $value Link for the displayed user's profile.1903 */1904 return apply_filters( 'bp_get_displayed_user_link', bp_displayed_user_domain() );1905 }1906 1907 /**1908 * Alias of {@link bp_displayed_user_domain()}.1909 *1910 * @deprecated1911 */1912 function bp_user_link() {1913 bp_displayed_user_domain();1914 }1915 1916 /**1917 1866 * Alias of {@link bp_displayed_user_id()}. 1918 1867 * … … 1924 1873 1925 1874 /** 1875 * Output the link for the displayed user's profile. 1876 * 1877 * @since 1.2.4 1878 */ 1879 function bp_displayed_user_link() { 1880 echo esc_url( bp_displayed_user_url() ); 1881 } 1882 1883 /** 1884 * Builds the logged-in user's profile URL. 1885 * 1886 * @since 12.0.0 1887 * 1888 * @param array $path_chunks { 1889 * An array of arguments. Optional. 1890 * 1891 * @type string $single_item_component The component slug the action is relative to. 1892 * @type string $single_item_action The slug of the action to perform. 1893 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1894 * } 1895 * @return string The logged-in user's profile URL. 1896 */ 1897 function bp_displayed_user_url( $path_chunks = array() ) { 1898 $bp = buddypress(); 1899 $url = ''; 1900 1901 if ( isset( $bp->displayed_user->domain ) ) { 1902 $url = $bp->displayed_user->domain; 1903 } 1904 1905 if ( $path_chunks ) { 1906 $url = bp_members_get_user_url( bp_displayed_user_id(), $path_chunks ); 1907 } 1908 1909 /** 1910 * Filter here to edit the displayed user's profile URL. 1911 * 1912 * @since 12.0.0 1913 * 1914 * @param string $url The displayed user's profile URL. 1915 * @param array $path_chunks { 1916 * An array of arguments. Optional. 1917 * 1918 * @type string $single_item_component The component slug the action is relative to. 1919 * @type string $single_item_action The slug of the action to perform. 1920 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1921 * } 1922 */ 1923 return apply_filters( 'bp_displayed_user_url', $url, $path_chunks ); 1924 } 1925 1926 /** 1926 1927 * Generate the link for the displayed user's profile. 1927 1928 * 1928 1929 * @since 1.0.0 1929 * 1930 * @since 12.0.0 This function is now an alias of `bp_displayed_user_url()`. 1931 * You should only use it to get the "home" URL of the displayed 1932 * user's profile page. If you need to build an URL to reach another 1933 * page, we strongly advise you to use `bp_displayed_user_url()`. 1934 * 1935 * @todo Deprecating this function would be safer. 1930 1936 * @return string 1931 1937 */ 1932 1938 function bp_displayed_user_domain() { 1933 $ bp = buddypress();1939 $url = bp_displayed_user_url(); 1934 1940 1935 1941 /** … … 1938 1944 * @since 1.0.0 1939 1945 * 1940 * @param string $value Generated link for the displayed user's profile. 1941 */ 1942 return apply_filters( 'bp_displayed_user_domain', isset( $bp->displayed_user->domain ) ? $bp->displayed_user->domain : '' ); 1946 * @param string $url Generated link for the displayed user's profile. 1947 */ 1948 return apply_filters( 'bp_displayed_user_domain',$url ); 1949 } 1950 1951 /** 1952 * Output the link for the logged-in user's profile. 1953 * 1954 * @since 1.2.4 1955 */ 1956 function bp_loggedin_user_link() { 1957 echo esc_url( bp_loggedin_user_url() ); 1958 } 1959 1960 /** 1961 * Builds the logged-in user's profile URL. 1962 * 1963 * @since 12.0.0 1964 * 1965 * @param array $path_chunks { 1966 * An array of arguments. Optional. 1967 * 1968 * @type string $single_item_component The component slug the action is relative to. 1969 * @type string $single_item_action The slug of the action to perform. 1970 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1971 * } 1972 * @return string The logged-in user's profile URL. 1973 */ 1974 function bp_loggedin_user_url( $path_chunks = array() ) { 1975 $bp = buddypress(); 1976 $url = ''; 1977 1978 if ( isset( $bp->loggedin_user->domain ) ) { 1979 $url = $bp->loggedin_user->domain; 1980 } 1981 1982 if ( $path_chunks ) { 1983 $url = bp_members_get_user_url( bp_loggedin_user_id(), $path_chunks ); 1984 } 1985 1986 /** 1987 * Filter here to edit the logged-in user's profile URL. 1988 * 1989 * @since 12.0.0 1990 * 1991 * @param string $url The logged-in user's profile URL. 1992 * @param array $path_chunks { 1993 * An array of arguments. Optional. 1994 * 1995 * @type string $single_item_component The component slug the action is relative to. 1996 * @type string $single_item_action The slug of the action to perform. 1997 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1998 * } 1999 */ 2000 return apply_filters( 'bp_loggedin_user_url', $url, $path_chunks ); 1943 2001 } 1944 2002 … … 1947 2005 * 1948 2006 * @since 1.0.0 1949 * 2007 * @since 12.0.0 This function is now an alias of `bp_loggedin_user_url()`. 2008 * You should only use it to get the "home" URL of the logged-in 2009 * user's profile page. If you need to build an URL to reach another 2010 * page, we strongly advise you to use `bp_loggedin_user_url()`. 2011 * 2012 * @todo Deprecating this function would be safer. 1950 2013 * @return string 1951 2014 */ 1952 2015 function bp_loggedin_user_domain() { 1953 $ bp = buddypress();2016 $url = bp_loggedin_user_url(); 1954 2017 1955 2018 /** … … 1958 2021 * @since 1.0.0 1959 2022 * 1960 * @param string $ valueGenerated link for the logged-in user's profile.1961 */ 1962 return apply_filters( 'bp_loggedin_user_domain', isset( $bp->loggedin_user->domain ) ? $bp->loggedin_user->domain : '');2023 * @param string $url Generated link for the logged-in user's profile. 2024 */ 2025 return apply_filters( 'bp_loggedin_user_domain', $url ); 1963 2026 } 1964 2027 … … 2347 2410 function bp_get_signup_page() { 2348 2411 if ( bp_has_custom_signup_page() ) { 2349 $page = trailingslashit( bp_get_root_domain() . '/' . bp_get_signup_slug() ); 2412 $page = bp_rewrites_get_url( 2413 array( 2414 'component_id' => 'members', 2415 'member_register' => 1, 2416 ) 2417 ); 2418 2350 2419 } else { 2351 $page = bp_get_root_domain() . '/wp-signup.php';2420 $page = trailingslashit( bp_get_root_url() ) . 'wp-signup.php'; 2352 2421 } 2353 2422 … … 2396 2465 function bp_get_activation_page() { 2397 2466 if ( bp_has_custom_activation_page() ) { 2398 $page = trailingslashit( bp_get_root_domain() . '/' . bp_get_activate_slug() ); 2467 $page = bp_rewrites_get_url( 2468 array( 2469 'component_id' => 'members', 2470 'member_activate' => 1, 2471 ) 2472 ); 2473 2399 2474 } else { 2400 $page = trailingslashit( bp_get_root_ domain() ) . 'wp-activate.php';2475 $page = trailingslashit( bp_get_root_url() ) . 'wp-activate.php'; 2401 2476 } 2402 2477 … … 3566 3641 if ( 0 === $user_id ) { 3567 3642 $user_id = bp_loggedin_user_id(); 3568 $domain = bp_loggedin_user_domain(); 3569 } else { 3570 $domain = bp_members_get_user_url( (int) $user_id ); 3571 } 3572 3573 $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/list-invites' ); 3643 } 3644 3645 $retval = bp_members_get_user_url( 3646 (int) $user_id, 3647 array( 3648 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_invitations', bp_get_members_invitations_slug() ), 3649 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_invitations_list_invites', 'list-invites' ), 3650 ) 3651 ); 3574 3652 3575 3653 /** … … 3605 3683 if ( 0 === $user_id ) { 3606 3684 $user_id = bp_loggedin_user_id(); 3607 $domain = bp_loggedin_user_domain(); 3608 } else { 3609 $domain = bp_members_get_user_url( (int) $user_id ); 3610 } 3611 3612 $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/send-invites' ); 3685 } 3686 3687 $retval = bp_members_get_user_url( 3688 (int) $user_id, 3689 array( 3690 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_invitations', bp_get_members_invitations_slug() ), 3691 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_invitations_send_invites', 'send-invites' ), 3692 ) 3693 ); 3613 3694 3614 3695 /** -
trunk/src/bp-members/classes/class-bp-members-component.php
r13433 r13436 215 215 public function setup_additional_globals() { 216 216 $bp = buddypress(); 217 218 // Set-up Extra permastructs for the register and activate pages. 219 $this->register_permastruct = bp_get_signup_slug() . '/%' . $this->rewrite_ids['member_register'] . '%'; 220 $this->activate_permastruct = bp_get_activate_slug() . '/%' . $this->rewrite_ids['member_activate'] . '%'; 217 221 218 222 /** Logged in user *************************************************** … … 784 788 785 789 /** 790 * Add the Registration and Activation rewrite tags. 791 * 792 * @since 12.0.0 793 * 794 * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for 795 * description. 796 */ 797 public function add_rewrite_tags( $rewrite_tags = array() ) { 798 $rewrite_tags = array( 799 'member_register' => '([1]{1,})', 800 'member_activate' => '([1]{1,})', 801 'member_activate_key' => '([^/]+)', 802 ); 803 804 parent::add_rewrite_tags( $rewrite_tags ); 805 } 806 807 /** 808 * Add the Registration and Activation rewrite rules. 809 * 810 * @since 12.0.0 811 * 812 * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for 813 * description. 814 */ 815 public function add_rewrite_rules( $rewrite_rules = array() ) { 816 $rewrite_rules = array( 817 'directory_type' => array( 818 'regex' => $this->root_slug . '/' . bp_get_members_member_type_base() . '/([^/]+)/?$', 819 'order' => 50, 820 'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['directory_type'] . '=$matches[1]', 821 ), 822 'member_activate' => array( 823 'regex' => bp_get_activate_slug(), 824 'order' => 40, 825 'query' => 'index.php?' . $this->rewrite_ids['member_activate'] . '=1', 826 ), 827 'member_activate_key' => array( 828 'regex' => bp_get_activate_slug() . '/([^/]+)/?$', 829 'order' => 30, 830 'query' => 'index.php?' . $this->rewrite_ids['member_activate'] . '=1&' . $this->rewrite_ids['member_activate_key'] . '=$matches[1]', 831 ), 832 'member_register' => array( 833 'regex' => bp_get_signup_slug(), 834 'order' => 20, 835 'query' => 'index.php?' . $this->rewrite_ids['member_register'] . '=1', 836 ), 837 ); 838 839 parent::add_rewrite_rules( $rewrite_rules ); 840 } 841 842 /** 843 * Add the Registration and Activation permastructs. 844 * 845 * @since 12.0.0 846 * 847 * @param array $permastructs Optional. See BP_Component::add_permastructs() for 848 * description. 849 */ 850 public function add_permastructs( $permastructs = array() ) { 851 $permastructs = array( 852 // Register permastruct. 853 $this->rewrite_ids['member_register'] => array( 854 'permastruct' => $this->register_permastruct, 855 'args' => array(), 856 ), 857 // Activate permastruct. 858 $this->rewrite_ids['member_activate'] => array( 859 'permastruct' => $this->activate_permastruct, 860 'args' => array(), 861 ), 862 ); 863 864 parent::add_permastructs( $permastructs ); 865 } 866 867 /** 786 868 * Init the BP REST API. 787 869 * -
trunk/src/bp-members/screens/activate.php
r13125 r13436 27 27 $redirect_to = bp_is_component_front_page( 'activate' ) 28 28 ? bp_get_members_directory_permalink() 29 : bp_get_root_ domain();29 : bp_get_root_url(); 30 30 31 31 // Trailing slash it, as we expect these URL's to be. -
trunk/src/bp-members/screens/register.php
r13223 r13436 28 28 $redirect_to = bp_is_component_front_page( 'register' ) 29 29 ? bp_get_members_directory_permalink() 30 : bp_get_root_ domain();30 : bp_get_root_url(); 31 31 32 32 /** … … 158 158 // This situation doesn't naturally occur so bounce to website root. 159 159 } else { 160 bp_core_redirect( bp_get_root_ domain() );160 bp_core_redirect( bp_get_root_url() ); 161 161 } 162 162 } -
trunk/src/bp-messages/bp-messages-template.php
r13433 r13436 338 338 } 339 339 340 $domain = bp_members_get_user_url( $user_id ); 340 $url = bp_members_get_user_url( 341 $user_id, 342 array( 343 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 344 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_messages_view', 'view' ), 345 'single_item_action_variables' => array( $thread_id ), 346 ) 347 ); 341 348 342 349 /** … … 347 354 * @since 2.9.0 Added the `$user_id` parameter. 348 355 * 349 * @param string $ valuePermalink of a particular thread.356 * @param string $url Permalink of a particular thread. 350 357 * @param int $thread_id ID of the thread. 351 358 * @param int $user_id ID of the user. 352 359 */ 353 return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( $domain . bp_get_messages_slug() . '/view/' . $thread_id ), $thread_id, $user_id );360 return apply_filters( 'bp_get_message_thread_view_link', $url, $thread_id, $user_id ); 354 361 } 355 362 … … 383 390 } 384 391 385 $domain = bp_members_get_user_url( $user_id ); 392 $current_action_slug = bp_current_action(); 393 $current_action_rewrite_id = 'member_messages_' . $current_action_slug; 394 $action_variable_delete_slug = bp_rewrites_get_slug( 'members', $current_action_rewrite_id . '_delete', 'delete' ); 395 396 $url = bp_members_get_user_url( 397 $user_id, 398 array( 399 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 400 'single_item_action' => bp_rewrites_get_slug( 'members', $current_action_rewrite_id, $current_action_slug ), 401 'single_item_action_variables' => array( $action_variable_delete_slug, $messages_template->thread->thread_id ), 402 ) 403 ); 386 404 387 405 /** … … 390 408 * @since 1.0.0 391 409 * 392 * @param string $ valueURL for deleting the current thread.410 * @param string $url URL for deleting the current thread. 393 411 * @param int $user_id ID of the user relative to whom the link should be generated. 394 412 */ 395 return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( $domain . bp_get_messages_slug() . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ), $user_id );413 return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( $url, 'messages_delete_thread' ), $user_id ); 396 414 } 397 415 … … 435 453 } 436 454 437 $domain = bp_members_get_user_url( $user_id ); 455 $current_action_slug = bp_current_action(); 456 $current_action_rewrite_id = 'member_messages_' . $current_action_slug; 457 $action_variable_unread_slug = bp_rewrites_get_slug( 'members', $current_action_rewrite_id . '_unread', 'unread' ); 438 458 439 459 // Base unread URL. 440 $url = trailingslashit( $domain . bp_get_messages_slug() . '/' . bp_current_action() . '/unread' ); 460 $url = bp_members_get_user_url( 461 $user_id, 462 array( 463 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 464 'single_item_action' => bp_rewrites_get_slug( 'members', $current_action_rewrite_id, $current_action_slug ), 465 'single_item_action_variables' => array( $action_variable_unread_slug ), 466 ) 467 ); 441 468 442 469 // Add the args to the URL. … … 497 524 } 498 525 499 $domain = bp_members_get_user_url( $user_id ); 526 $current_action_slug = bp_current_action(); 527 $current_action_rewrite_id = 'member_messages_' . $current_action_slug; 528 $action_variable_read_slug = bp_rewrites_get_slug( 'members', $current_action_rewrite_id . '_read', 'read' ); 500 529 501 530 // Base read URL. 502 $url = trailingslashit( $domain . bp_get_messages_slug() . '/' . bp_current_action() . '/read' ); 531 $url = bp_members_get_user_url( 532 $user_id, 533 array( 534 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 535 'single_item_action' => bp_rewrites_get_slug( 'members', $current_action_rewrite_id, $current_action_slug ), 536 'single_item_action_variables' => array( $action_variable_read_slug ), 537 ) 538 ); 503 539 504 540 // Add the args to the URL. -
trunk/src/bp-notifications/bp-notifications-template.php
r13433 r13436 61 61 if ( 0 === $user_id ) { 62 62 $user_id = bp_loggedin_user_id(); 63 $domain = bp_loggedin_user_domain();64 } else {65 $domain = bp_members_get_user_url( (int) $user_id );66 63 } 67 64 68 $retval = trailingslashit( $domain . bp_get_notifications_slug() ); 65 $retval = bp_members_get_user_url( 66 $user_id, 67 array( 68 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_notifications', bp_get_notifications_slug() ), 69 ) 70 ); 69 71 70 72 /** … … 102 104 if ( 0 === $user_id ) { 103 105 $user_id = bp_loggedin_user_id(); 104 $domain = bp_loggedin_user_domain();105 } else {106 $domain = bp_members_get_user_url( (int) $user_id );107 106 } 108 107 109 $retval = trailingslashit( $domain . bp_get_notifications_slug() . '/unread' ); 108 $retval = bp_members_get_user_url( 109 $user_id, 110 array( 111 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_notifications', bp_get_notifications_slug() ), 112 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_notifications_unread', 'unread' ), 113 ) 114 ); 110 115 111 116 /** … … 142 147 if ( 0 === $user_id ) { 143 148 $user_id = bp_loggedin_user_id(); 144 $domain = bp_loggedin_user_domain();145 } else {146 $domain = bp_members_get_user_url( (int) $user_id );147 149 } 148 150 149 $retval = trailingslashit( $domain . bp_get_notifications_slug() . '/read' ); 151 $retval = bp_members_get_user_url( 152 $user_id, 153 array( 154 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_notifications', bp_get_notifications_slug() ), 155 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_notifications_read', 'read' ), 156 ) 157 ); 150 158 151 159 /** -
trunk/src/bp-settings/actions/delete-account.php
r13090 r13436 59 59 60 60 // Redirect to the root domain. 61 bp_core_redirect( bp_get_root_ domain() );61 bp_core_redirect( bp_get_root_url() ); 62 62 } 63 63 } -
trunk/src/bp-templates/bp-legacy/buddypress/members/activate.php
r12595 r13436 48 48 <?php 49 49 /* translators: %s: login url */ 50 printf( __( 'Your account was activated successfully! You can now <a href="%s">log in</a> with the username and password you provided when you signed up.', 'buddypress' ), wp_login_url( bp_get_root_ domain() ) );50 printf( __( 'Your account was activated successfully! You can now <a href="%s">log in</a> with the username and password you provided when you signed up.', 'buddypress' ), wp_login_url( bp_get_root_url() ) ); 51 51 ?> 52 52 </p> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/activate.php
r12220 r13436 27 27 printf( 28 28 '<p><a href="%1$s">%2$s</a></p>', 29 esc_url( wp_login_url( bp_get_root_ domain() ) ),29 esc_url( wp_login_url( bp_get_root_url() ) ), 30 30 esc_html__( 'Log In', 'buddypress' ) 31 31 ); -
trunk/src/bp-templates/bp-nouveau/includes/activity/template-tags.php
r13213 r13436 553 553 } 554 554 555 $spam_link = bp_rewrites_get_url( 556 array( 557 'component_id' => 'activity', 558 'single_item_action' => 'spam', 559 'single_item_action_variables' => array( bp_get_activity_id() ), 560 ) 561 ); 562 555 563 $buttons['activity_spam']['button_attr'][ $data_element ] = wp_nonce_url( 556 bp_get_root_domain() . '/' . bp_nouveau_get_component_slug( 'activity' ) . '/spam/' . $activity_id . '/', 564 bp_rewrites_get_url( 565 array( 566 'component_id' => 'activity', 567 'single_item_action' => 'spam', 568 'single_item_action_variables' => array( $activity_id ), 569 ) 570 ), 557 571 'bp_activity_akismet_spam_' . $activity_id 558 572 ); … … 882 896 883 897 $buttons['activity_comment_spam']['button_attr'][ $data_element ] = wp_nonce_url( 884 bp_get_root_domain() . '/' . bp_nouveau_get_component_slug( 'activity' ) . '/spam/' . $activity_comment_id . '/?cid=' . $activity_comment_id, 898 add_query_arg( 899 'cid', 900 $activity_comment_id, 901 bp_rewrites_get_url( 902 array( 903 'component_id' => 'activity', 904 'single_item_action' => 'spam', 905 'single_item_action_variables' => array( $activity_comment_id ), 906 ) 907 ) 908 ), 885 909 'bp_activity_akismet_spam_' . $activity_comment_id 886 910 ); -
trunk/src/bp-templates/bp-nouveau/includes/blogs/functions.php
r13303 r13436 20 20 'slug' => 'all', // slug is used because BP_Core_Nav requires it, but it's the scope 21 21 'li_class' => array( 'selected' ), 22 'link' => bp_get_ root_domain() . '/' . bp_get_blogs_root_slug(),22 'link' => bp_get_blogs_directory_url(), 23 23 'text' => __( 'All Sites', 'buddypress' ), 24 24 'count' => bp_get_total_blog_count(), … … 44 44 // If the user can create blogs, add the create nav 45 45 if ( bp_blog_signup_enabled() ) { 46 $url = bp_get_blogs_directory_url( 47 array( 48 'create_single_item' => 1, 49 ) 50 ); 51 46 52 $nav_items['create'] = array( 47 53 'component' => 'blogs', 48 54 'slug' => 'create', // slug is used because BP_Core_Nav requires it, but it's the scope 49 55 'li_class' => array( 'no-ajax', 'site-create', 'create-button' ), 50 'link' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),56 'link' => $url, 51 57 'text' => __( 'Create a Site', 'buddypress' ), 52 58 'count' => false, -
trunk/tests/phpunit/includes/testcase.php
r13433 r13436 296 296 public function go_to_root() { 297 297 $blog_1_url = get_blog_option( 1, 'home' ); 298 $this->go_to( str_replace( $blog_1_url, '', trailingslashit( bp_get_root_ domain() ) ) );298 $this->go_to( str_replace( $blog_1_url, '', trailingslashit( bp_get_root_url() ) ) ); 299 299 } 300 300 -
trunk/tests/phpunit/testcases/activity/class.BP_Activity_Activity.php
r13396 r13436 330 330 // bp_activity_new_comment() doesn't allow date_recorded 331 331 $a3 = bp_activity_add( array( 332 'action' => sprintf( __( '%s posted a new activity comment', 'buddypress' ), bp_ get_loggedin_user_link() ) ,332 'action' => sprintf( __( '%s posted a new activity comment', 'buddypress' ), bp_loggedin_user_url() ) , 333 333 'content' => 'Candy is good', 334 334 'component' => buddypress()->activity->id, -
trunk/tests/phpunit/testcases/activity/notifications.php
r13433 r13436 389 389 */ 390 390 public function test_bp_activity_comment_add_notification() { 391 $this->set_permalink_structure( '/%postname%/' ); 391 392 $a = self::factory()->activity->create( array( 392 393 'user_id' => $this->u1, -
trunk/tests/phpunit/testcases/core/functions/bpCoreGetDirectoryPageId.php
r12895 r13436 7 7 */ 8 8 class BP_Tests_Core_BpCoreGetDirectoryPageId extends BP_UnitTestCase { 9 protected $permalink_structure = ''; 10 11 public function set_up() { 12 parent::set_up(); 13 $this->permalink_structure = get_option( 'permalink_structure', '' ); 14 } 15 16 public function tear_down() { 17 parent::tear_down(); 18 $this->set_permalink_structure( $this->permalink_structure ); 19 } 20 9 21 public function test_should_fall_back_on_current_component() { 22 $this->set_permalink_structure( '/%postname%/' ); 10 23 $this->go_to( bp_get_activity_directory_permalink() ); 11 24 … … 17 30 18 31 public function test_should_accept_component_override() { 32 $this->set_permalink_structure( '/%postname%/' ); 19 33 $this->go_to( bp_get_activity_directory_permalink() ); 20 34 -
trunk/tests/phpunit/testcases/core/nav/backCompat.php
r13314 r13436 10 10 protected $bp_nav; 11 11 protected $bp_options_nav; 12 protected $permalink_structure = ''; 12 13 13 14 public function set_up() { … … 15 16 $this->bp_nav = buddypress()->bp_nav; 16 17 $this->bp_options_nav = buddypress()->bp_options_nav; 18 $this->permalink_structure = get_option( 'permalink_structure', '' ); 17 19 } 18 20 … … 20 22 buddypress()->bp_nav = $this->bp_nav; 21 23 buddypress()->bp_options_nav = $this->bp_options_nav; 24 $this->set_permalink_structure( $this->permalink_structure ); 22 25 parent::tear_down(); 23 26 } … … 46 49 */ 47 50 protected function set_up_group() { 51 $this->set_permalink_structure( '/%postname%/' ); 48 52 $g = self::factory()->group->create( array( 49 53 'slug' => 'testgroup', -
trunk/tests/phpunit/testcases/core/nav/bpCoreMaybeHookNewSubnavScreenFunction.php
r13433 r13436 207 207 $found = bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ); 208 208 $this->assertSame( 'failure', $found['status'] ); 209 $this->assertSame( bp_get_root_ domain(), $found['redirect_args']['root'] );209 $this->assertSame( bp_get_root_url(), $found['redirect_args']['root'] ); 210 210 211 211 // Clean up -
trunk/tests/phpunit/testcases/core/nav/bpCoreNewNavItem.php
r13433 r13436 74 74 $old_current_user = get_current_user_id(); 75 75 $this->set_current_user( $u ); 76 $this->set_permalink_structure( '/%postname%/' ); 76 77 77 78 $group = groups_get_group( $g ); -
trunk/tests/phpunit/testcases/groups/class-bp-group-extension.php
r13195 r13436 8 8 */ 9 9 class BP_Tests_Group_Extension_TestCases extends BP_UnitTestCase { 10 protected $permalink_structure = ''; 11 12 public function set_up() { 13 parent::set_up(); 14 $this->permalink_structure = get_option( 'permalink_structure', '' ); 15 } 16 17 public function tear_down() { 18 parent::tear_down(); 19 $this->set_permalink_structure( $this->permalink_structure ); 20 } 21 10 22 public function test_parse_legacy_properties() { 11 23 $class_name = 'BPTest_Group_Extension_Parse_Legacy_Properties'; … … 222 234 public function test_enable_nav_item_true() { 223 235 $old_options_nav = buddypress()->bp_options_nav; 236 $this->set_permalink_structure( '/%postname%/' ); 224 237 225 238 $g = self::factory()->group->create(); … … 244 257 */ 245 258 public function test_enable_nav_item_false() { 259 $this->set_permalink_structure( '/%postname%/' ); 246 260 $old_options_nav = buddypress()->bp_options_nav; 247 261 … … 267 281 */ 268 282 public function test_visibility_private() { 283 $this->set_permalink_structure( '/%postname%/' ); 269 284 $old_options_nav = buddypress()->bp_options_nav; 270 285 $old_current_user = get_current_user_id(); … … 311 326 */ 312 327 public function test_visibility_public() { 328 $this->set_permalink_structure( '/%postname%/' ); 313 329 $old_options_nav = buddypress()->bp_options_nav; 314 330 $old_current_user = get_current_user_id(); … … 348 364 */ 349 365 public function test_user_can_visit_inferred_from_enable_nav_item() { 366 $this->set_permalink_structure( '/%postname%/' ); 350 367 $old_current_user = get_current_user_id(); 351 368 … … 373 390 */ 374 391 public function test_user_can_visit_explicit_for_logged_out_user() { 392 $this->set_permalink_structure( '/%postname%/' ); 375 393 $old_current_user = get_current_user_id(); 376 394 $this->set_current_user( 0 ); … … 413 431 */ 414 432 public function test_user_can_visit_explicit_for_logged_in_user() { 433 $this->set_permalink_structure( '/%postname%/' ); 415 434 $g = self::factory()->group->create( array( 416 435 'status' => 'public', … … 455 474 */ 456 475 public function test_user_can_visit_explicit_for_group_member() { 476 $this->set_permalink_structure( '/%postname%/' ); 457 477 $g = self::factory()->group->create( array( 458 478 'status' => 'public', … … 499 519 */ 500 520 public function test_user_can_visit_explicit_for_group_mod() { 521 $this->set_permalink_structure( '/%postname%/' ); 501 522 $g = self::factory()->group->create( array( 502 523 'status' => 'public', … … 545 566 */ 546 567 public function test_user_can_visit_explicit_for_group_admin() { 568 $this->set_permalink_structure( '/%postname%/' ); 547 569 $g = self::factory()->group->create( array( 548 570 'status' => 'public', … … 591 613 */ 592 614 public function test_user_can_see_nav_item_implied() { 615 $this->set_permalink_structure( '/%postname%/' ); 593 616 $g = self::factory()->group->create( array( 594 617 'status' => 'public', … … 632 655 */ 633 656 public function test_user_can_see_nav_item_explicit_for_logged_out_user() { 657 $this->set_permalink_structure( '/%postname%/' ); 634 658 $g = self::factory()->group->create( array( 635 659 'status' => 'public', … … 673 697 */ 674 698 public function test_user_can_see_nav_item_explicit_for_logged_in_user() { 699 $this->set_permalink_structure( '/%postname%/' ); 675 700 $g = self::factory()->group->create( array( 676 701 'status' => 'public', … … 715 740 */ 716 741 public function test_user_can_see_nav_item_explicit_for_group_member() { 742 $this->set_permalink_structure( '/%postname%/' ); 717 743 $g = self::factory()->group->create( array( 718 744 'status' => 'public', … … 759 785 */ 760 786 public function test_user_can_see_nav_item_explicit_for_group_mod() { 787 $this->set_permalink_structure( '/%postname%/' ); 761 788 $g = self::factory()->group->create( array( 762 789 'status' => 'public', … … 805 832 */ 806 833 public function test_user_can_see_nav_item_explicit_for_group_admin() { 834 $this->set_permalink_structure( '/%postname%/' ); 807 835 $g = self::factory()->group->create( array( 808 836 'status' => 'public', … … 851 879 */ 852 880 public function test_widget_on_group_home_page() { 881 $this->set_permalink_structure( '/%postname%/' ); 853 882 $g = self::factory()->group->create( array( 854 883 'status' => 'public', … … 872 901 */ 873 902 public function test_widget_on_group_members_page() { 903 $this->set_permalink_structure( '/%postname%/' ); 874 904 $g = self::factory()->group->create( array( 875 905 'status' => 'public', … … 893 923 */ 894 924 public function test_adding_multiple_extension_classes() { 925 $this->set_permalink_structure( '/%postname%/' ); 895 926 $old_options_nav = buddypress()->bp_options_nav; 896 927 -
trunk/tests/phpunit/testcases/groups/class-bp-groups-member.php
r13314 r13436 7 7 static public $user_ids; 8 8 static public $group_ids; 9 protected $permalink_structure = ''; 10 11 public function set_up() { 12 parent::set_up(); 13 $this->permalink_structure = get_option( 'permalink_structure', '' ); 14 } 15 16 public function tear_down() { 17 parent::tear_down(); 18 $this->set_permalink_structure( $this->permalink_structure ); 19 } 9 20 10 21 public static function wpSetUpBeforeClass( $factory ) { … … 161 172 */ 162 173 public function test_bp_groups_user_can_send_invites() { 174 $this->set_permalink_structure( '/%postname%/' ); 163 175 $u_nonmembers = self::factory()->user->create(); 164 176 $u_members = self::factory()->user->create(); -
trunk/tests/phpunit/testcases/members/template/bpGetMemberTypeDirectoryPermalink.php
r13314 r13436 6 6 */ 7 7 class BP_Tests_Members_Template_BpGetMemberTypeDirectoryPermalink extends BP_UnitTestCase { 8 protected $permalink_structure = ''; 9 8 10 public function set_up() { 9 11 parent::set_up(); 10 12 11 13 buddypress()->members->types = array(); 14 $this->permalink_structure = get_option( 'permalink_structure', '' ); 15 } 16 17 public function tear_down() { 18 parent::tear_down(); 19 20 $this->set_permalink_structure( $this->permalink_structure ); 12 21 } 13 22 … … 16 25 */ 17 26 public function test_should_default_to_current_member_type() { 27 $this->set_permalink_structure( '/%postname%/' ); 28 18 29 bp_register_member_type( 'foo', array( 19 30 'has_directory' => true, … … 31 42 */ 32 43 public function test_member_type_param_should_override_current_member_type() { 44 $this->set_permalink_structure( '/%postname%/' ); 45 33 46 bp_register_member_type( 'foo', array( 34 47 'has_directory' => true, … … 71 84 */ 72 85 public function test_successful_format() { 86 $this->set_permalink_structure( '/%postname%/' ); 87 73 88 bp_register_member_type( 'foo', array( 74 89 'has_directory' => true,
Note: See TracChangeset
for help on using the changeset viewer.