Skip to:
Content

BuddyPress.org

Changeset 13515


Ignore:
Timestamp:
07/12/2023 04:00:13 AM (14 months ago)
Author:
imath
Message:

Improve the tool to reset all BP URL slugs

Instead of only deleting the custom slugs’ post metas, let’s completely remap component directories to buddypress post types using the bp_core_add_page_mappings() function.

Doing so is making it possible to clean up buddypress post type entries for no more active components.

Fixes #8934
Closes https://github.com/buddypress/buddypress/pull/128

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-tools.php

    r13468 r13515  
    194194    $statement = __( 'Removing all custom slugs and resetting default ones… %s', 'buddypress' );
    195195
    196     $bp_pages = bp_core_get_directory_page_ids( 'all' );
    197     foreach ( $bp_pages as $page_id ) {
    198         delete_post_meta( $page_id, '_bp_component_slugs' );
    199     }
     196    bp_core_add_page_mappings( buddypress()->active_components, 'delete' );
    200197
    201198    // Delete BP Pages cache and rewrite rules.
Note: See TracChangeset for help on using the changeset viewer.