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-core/admin/bp-core-admin-functions.php

    r13395 r13431  
    310310
    311311    if ( ! empty( $orphaned_components ) ) {
    312         $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
    313         $notice    = sprintf(
    314             '%1$s <a href="%2$s">%3$s</a>',
    315             sprintf(
    316                 // Translators: %s is the comma separated list of components needing a directory page.
    317                 __( 'The following active BuddyPress Components do not have associated WordPress Pages: %s.', 'buddypress' ),
    318                 '<strong>' . implode( '</strong>, <strong>', array_map( 'esc_html', $orphaned_components ) ) . '</strong>'
    319             ),
    320             esc_url( $admin_url ),
    321             __( 'Repair', 'buddypress' )
     312        $notice = sprintf(
     313            // Translators: %s is the comma separated list of components needing a directory page.
     314            __( 'The following active BuddyPress Components do not have associated BuddyPress Pages: %s.', 'buddypress' ),
     315            '<strong>' . implode( '</strong>, <strong>', array_map( 'esc_html', $orphaned_components ) ) . '</strong>'
    322316        );
    323317
     
    341335    // If there are duplicates, post a message about them.
    342336    if ( ! empty( $dupe_names ) ) {
    343         $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
    344         $notice    = sprintf(
    345             '%1$s <a href="%2$s">%3$s</a>',
    346             sprintf(
    347                 // Translators: %s is the list of directory pages associated to more than one component.
    348                 __( 'Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %s.', 'buddypress' ),
    349                 '<strong>' . implode( '</strong>, <strong>', array_map( 'esc_html', $dupe_names ) ) . '</strong>'
    350             ),
    351             esc_url( $admin_url ),
    352             __( 'Repair', 'buddypress' )
     337        $notice = ssprintf(
     338            // Translators: %s is the list of directory pages associated to more than one component.
     339            __( 'Each BuddyPress Component needs its own BuddyPress page. The following BuddyPress Pages have more than one component associated with them: %s.', 'buddypress' ),
     340            '<strong>' . implode( '</strong>, <strong>', array_map( 'esc_html', $dupe_names ) ) . '</strong>'
    353341        );
    354342
     
    506494            'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
    507495            'name' => __( 'Options', 'buddypress' ),
    508         ),
    509         '1' => array(
    510             'id'   => 'bp-page-settings',
    511             'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
    512             'name' => __( 'Pages', 'buddypress' ),
    513496        ),
    514497        '3' => array(
Note: See TracChangeset for help on using the changeset viewer.