Changeset 9701
- Timestamp:
- 04/06/2015 03:19:56 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-buddybar.php
r9600 r9701 297 297 // Link was not forced, so create one 298 298 if ( empty( $link ) ) { 299 $link = $parent_url . $slug;299 $link = trailingslashit( $parent_url . $slug ); 300 300 301 301 // If this sub item is the default for its parent, skip the slug 302 302 if ( ! empty( $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) && $slug == $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) { 303 $link = $parent_url;303 $link = trailingslashit( $parent_url ); 304 304 } 305 305 } … … 314 314 $subnav_item = array( 315 315 'name' => $name, 316 'link' => trailingslashit( $link ),316 'link' => $link, 317 317 'slug' => $slug, 318 318 'css_id' => $item_css_id, -
trunk/tests/phpunit/testcases/core/nav.php
r9700 r9701 382 382 $this->assertSame( $expected, buddypress()->bp_options_nav['foo-parent']['bar']['link'] ); 383 383 } 384 385 /** 386 * @group bp_core_new_subnav_item 387 * @ticket BP6353 388 */ 389 public function test_bp_core_new_subnav_item_link_should_not_trailingslash_link_explicit_link() { 390 $link = 'http://example.com/foo/bar/blah/?action=edit&id=30'; 391 392 bp_core_new_subnav_item( array( 393 'name' => 'bar', 394 'slug' => 'bar', 395 'parent_slug' => 'foo', 396 'parent_url' => 'http://example.com/foo/', 397 'screen_function' => 'foo', 398 'link' => $link, 399 ) ); 400 401 $this->assertSame( $link, buddypress()->bp_options_nav['foo']['bar']['link'] ); 402 } 384 403 }
Note: See TracChangeset
for help on using the changeset viewer.