Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/08/2023 06:31:46 AM (12 months ago)
Author:
imath
Message:

Make sure all Groups component URLs are built using BP rewrites API

  • Introduce the bp_groups_get_create_url() to ease Groups create URLs generation.
  • Improve bp_groups_get_path_chunks() to deal with front-end group admin URLs and the Groups create URLs.
  • Deprecate bp_get_groups_directory_permalink() in favor of bp_get_groups_directory_url().
  • Replace all remaining deprecated functions usage.
  • Start putting deprecated functions behind a function_exists( 'bp_classic' ) check, corresponding functions were added inside the BP Classic backcompat plugin.
  • Adjust some Groups routing unit tests.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/83
See #4954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/nav/bpCoreNewSubnavItem.php

    r13441 r13449  
    224224            'slug' => 'bar',
    225225            'parent_slug' => 'foo',
    226             'parent_url' => bp_get_root_domain() . 'foo/',
    227             'screen_function' => 'foo',
    228         ) );
    229 
    230         $expected = bp_get_root_domain() . 'foo/bar/';
     226            'parent_url' => bp_get_root_url() . 'foo/',
     227            'screen_function' => 'foo',
     228        ) );
     229
     230        $expected = bp_get_root_url() . 'foo/bar/';
    231231        $this->assertSame( $expected, buddypress()->bp_options_nav['foo']['bar']['link'] );
    232232    }
     
    240240            'name' => 'foo',
    241241            'slug' => 'foo-parent',
    242             'link' => bp_get_root_domain() . 'foo-parent/',
     242            'link' => bp_get_root_url() . 'foo-parent/',
    243243            'default_subnav_slug' => 'bar',
    244244            'screen_function' => 'foo',
     
    249249            'slug' => 'bar',
    250250            'parent_slug' => 'foo-parent',
    251             'parent_url' => bp_get_root_domain() . '/foo-parent/',
     251            'parent_url' => bp_get_root_url() . '/foo-parent/',
    252252            'screen_function' => 'bar',
    253253        ) );
    254254
    255         $expected = bp_get_root_domain() . '/foo-parent/bar/';
     255        $expected = bp_get_root_url() . '/foo-parent/bar/';
    256256        $this->assertSame( $expected, buddypress()->bp_options_nav['foo-parent']['bar']['link'] );
    257257    }
     
    296296            'slug' => 'foo',
    297297            'parent_slug' => 'parent',
    298             'parent_url' => bp_get_root_domain() . '/parent/',
     298            'parent_url' => bp_get_root_url() . '/parent/',
    299299            'screen_function' => 'foo',
    300300            'site_admin_only' => true,
     
    318318            'slug' => 'foo',
    319319            'parent_slug' => 'parent',
    320             'parent_url' => bp_get_root_domain() . '/parent/',
     320            'parent_url' => bp_get_root_url() . '/parent/',
    321321            'screen_function' => 'foo',
    322322        );
     
    340340            'slug' => 'foo',
    341341            'parent_slug' => 'parent',
    342             'parent_url' => bp_get_root_domain() . '/parent/',
     342            'parent_url' => bp_get_root_url() . '/parent/',
    343343            'screen_function' => 'foo',
    344344            'item_css_id' => 'bar',
Note: See TracChangeset for help on using the changeset viewer.