Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/24/2023 09:37:44 AM (14 months ago)
Author:
imath
Message:

Use a custom post type instead of the page post type for directories

  • The buddypress post type is now the one used for the BP component

directory page.

  • Introduce the bp_core_set_unique_directory_page_slug() function to

make sure there is no conflict with an existing WP page when setting the
BP Component directory page post_name.

  • Introduce the bp_restricted custom status. We'll be able to use it for

future visibility features.

  • Deprecate the Admin Slugs screen and corresponding functions
  • Bump raw_db_version to 13422 (the first commit about merging BP

Rewrites).

  • Add an update function to update the post type of the existing BP

component directory pages and potential WP Nav Menus including these.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/routing/members.php

    r13314 r13431  
    2222    function test_members_directory() {
    2323        $this->go_to( bp_get_members_directory_permalink() );
    24         $this->assertEquals( bp_get_members_root_slug(), bp_current_component() );
     24
     25        $pages        = bp_core_get_directory_pages();
     26        $component_id = bp_current_component();
     27
     28        $this->assertEquals( bp_get_members_root_slug(), $pages->{$component_id}->slug );
    2529    }
    2630
     
    2832        $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) );
    2933        $this->assertTrue( bp_is_my_profile() );
    30     }
    31 
    32     /**
    33      * @ticket BP6475
    34      */
    35     public function test_member_directory_when_nested_under_wp_page() {
    36         $p = self::factory()->post->create( array(
    37             'post_type' => 'page',
    38             'post_name' => 'foo',
    39         ) );
    40 
    41         $members_page = get_page_by_path( 'members' );
    42 
    43         wp_update_post( array(
    44             'ID' => $members_page->ID,
    45             'post_parent' => $p,
    46         ) );
    47 
    48         $members_page_permalink = bp_get_root_domain() . '/foo/members/';
    49         $this->go_to( $members_page_permalink );
    50 
    51         $this->assertTrue( bp_is_members_component() );
    52         $this->assertEquals( '', bp_current_action() );
    5334    }
    5435
Note: See TracChangeset for help on using the changeset viewer.