Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/15/2023 08:16:46 AM (2 years ago)
Author:
imath
Message:

Make more BuddyPress generated links ready for BP Rewrites

  • Improve the Members component adding permastructs and custom rewrite

rules for registration and activation pages.

  • Improve the Blogs component adding custom rewrite rule to handle the

Blogs create page.

  • Make a huge progress about replacing all occurrences of

bp_get_root_domain() (45 replacements were performed).

  • Deprecate bp_groups_directory_permalink(),

bp_get_groups_directory_permalink(), bp_blogs_directory_permalink() &
bp_get_blogs_directory_permalink() and replace them with these new
functions: bp_groups_directory_url(), bp_get_groups_directory_url(),
bp_blogs_directory_url() & bp_get_blogs_directory_url().

  • Although bp_loggedin_user_domain() & bp_displayed_user_domain()

should also be deprecated, we're leaving them as aliases of the right
functions to use. Plugin authors shouldn't use them to build other links
than member's profile home url.

NB: these deprecations are required because these functions were used
to build BuddyPress URLs concatenating URL chunks. Once the BP Classic
plugin will be built we will adapt the code to remove these deprecation
notices.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/groups/class-bp-group-extension.php

    r13195 r13436  
    88 */
    99class 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
    1022    public function test_parse_legacy_properties() {
    1123        $class_name = 'BPTest_Group_Extension_Parse_Legacy_Properties';
     
    222234    public function test_enable_nav_item_true() {
    223235        $old_options_nav = buddypress()->bp_options_nav;
     236        $this->set_permalink_structure( '/%postname%/' );
    224237
    225238        $g = self::factory()->group->create();
     
    244257     */
    245258    public function test_enable_nav_item_false() {
     259        $this->set_permalink_structure( '/%postname%/' );
    246260        $old_options_nav = buddypress()->bp_options_nav;
    247261
     
    267281     */
    268282    public function test_visibility_private() {
     283        $this->set_permalink_structure( '/%postname%/' );
    269284        $old_options_nav = buddypress()->bp_options_nav;
    270285        $old_current_user = get_current_user_id();
     
    311326     */
    312327    public function test_visibility_public() {
     328        $this->set_permalink_structure( '/%postname%/' );
    313329        $old_options_nav = buddypress()->bp_options_nav;
    314330        $old_current_user = get_current_user_id();
     
    348364     */
    349365    public function test_user_can_visit_inferred_from_enable_nav_item() {
     366        $this->set_permalink_structure( '/%postname%/' );
    350367        $old_current_user = get_current_user_id();
    351368
     
    373390     */
    374391    public function test_user_can_visit_explicit_for_logged_out_user() {
     392        $this->set_permalink_structure( '/%postname%/' );
    375393        $old_current_user = get_current_user_id();
    376394        $this->set_current_user( 0 );
     
    413431     */
    414432    public function test_user_can_visit_explicit_for_logged_in_user() {
     433        $this->set_permalink_structure( '/%postname%/' );
    415434        $g = self::factory()->group->create( array(
    416435            'status' => 'public',
     
    455474     */
    456475    public function test_user_can_visit_explicit_for_group_member() {
     476        $this->set_permalink_structure( '/%postname%/' );
    457477        $g = self::factory()->group->create( array(
    458478            'status' => 'public',
     
    499519     */
    500520    public function test_user_can_visit_explicit_for_group_mod() {
     521        $this->set_permalink_structure( '/%postname%/' );
    501522        $g = self::factory()->group->create( array(
    502523            'status' => 'public',
     
    545566     */
    546567    public function test_user_can_visit_explicit_for_group_admin() {
     568        $this->set_permalink_structure( '/%postname%/' );
    547569        $g = self::factory()->group->create( array(
    548570            'status' => 'public',
     
    591613     */
    592614    public function test_user_can_see_nav_item_implied() {
     615        $this->set_permalink_structure( '/%postname%/' );
    593616        $g = self::factory()->group->create( array(
    594617            'status' => 'public',
     
    632655     */
    633656    public function test_user_can_see_nav_item_explicit_for_logged_out_user() {
     657        $this->set_permalink_structure( '/%postname%/' );
    634658        $g = self::factory()->group->create( array(
    635659            'status' => 'public',
     
    673697     */
    674698    public function test_user_can_see_nav_item_explicit_for_logged_in_user() {
     699        $this->set_permalink_structure( '/%postname%/' );
    675700        $g = self::factory()->group->create( array(
    676701            'status' => 'public',
     
    715740     */
    716741    public function test_user_can_see_nav_item_explicit_for_group_member() {
     742        $this->set_permalink_structure( '/%postname%/' );
    717743        $g = self::factory()->group->create( array(
    718744            'status' => 'public',
     
    759785     */
    760786    public function test_user_can_see_nav_item_explicit_for_group_mod() {
     787        $this->set_permalink_structure( '/%postname%/' );
    761788        $g = self::factory()->group->create( array(
    762789            'status' => 'public',
     
    805832     */
    806833    public function test_user_can_see_nav_item_explicit_for_group_admin() {
     834        $this->set_permalink_structure( '/%postname%/' );
    807835        $g = self::factory()->group->create( array(
    808836            'status' => 'public',
     
    851879     */
    852880    public function test_widget_on_group_home_page() {
     881        $this->set_permalink_structure( '/%postname%/' );
    853882        $g = self::factory()->group->create( array(
    854883            'status' => 'public',
     
    872901     */
    873902    public function test_widget_on_group_members_page() {
     903        $this->set_permalink_structure( '/%postname%/' );
    874904        $g = self::factory()->group->create( array(
    875905            'status' => 'public',
     
    893923     */
    894924    public function test_adding_multiple_extension_classes() {
     925        $this->set_permalink_structure( '/%postname%/' );
    895926        $old_options_nav = buddypress()->bp_options_nav;
    896927
Note: See TracChangeset for help on using the changeset viewer.