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/src/bp-blogs/bp-blogs-functions.php

    r13405 r13431  
    117117
    118118        // Truncate user blogs table.
    119         $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name}" );
     119        if ( $bp->is_phpunit_running ) {
     120            $query_part = 'DELETE FROM';
     121        } else {
     122            $query_part = 'TRUNCATE';
     123        }
     124
     125        $truncate = $wpdb->query( "{$query_part} {$bp->blogs->table_name}" );
    120126        if ( is_wp_error( $truncate ) ) {
    121127            return false;
     
    123129
    124130        // Truncate user blogmeta table.
    125         $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name_blogmeta}" );
     131        $truncate = $wpdb->query( "{$query_part} {$bp->blogs->table_name_blogmeta}" );
    126132        if ( is_wp_error( $truncate ) ) {
    127133            return false;
Note: See TracChangeset for help on using the changeset viewer.