Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/24/2023 09:37:44 AM (2 years 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/members/functions.php

    r13414 r13431  
    124124        $pages = bp_core_get_directory_pages();
    125125        $members_page = get_post( $pages->members->id );
    126         $members_page->post_name = 'new-members-slug';
    127         wp_update_post( $members_page );
     126        $new_members_slug = 'new-members-slug';
     127        $members_page->post_name = $new_members_slug;
     128        $p = wp_update_post( $members_page );
     129
     130        // Weird!
     131        if ( is_multisite() ) {
     132            $new_members_slug = get_post_field( 'post_name', $p );
     133        }
    128134
    129135        // Go back to members directory page and recheck user domain
    130         $this->go_to( trailingslashit( home_url( 'new-members-slug' ) ) );
     136        $this->go_to( trailingslashit( home_url( $new_members_slug ) ) );
    131137        $user = new WP_User( $user_id );
    132138
    133         $this->assertSame( home_url( 'new-members-slug' ) . '/' . $user->user_nicename . '/', bp_core_get_user_domain( $user_id ) );
     139        $this->assertSame( home_url( $new_members_slug ) . '/' . $user->user_nicename . '/', bp_core_get_user_domain( $user_id ) );
    134140    }
    135141
Note: See TracChangeset for help on using the changeset viewer.