Skip to:
Content

bbPress.org

Changeset 5401


Ignore:
Timestamp:
06/14/2014 10:42:52 PM (11 years ago)
Author:
johnjamesjacoby
Message:

De-deprecate bbp_remove_roles() and use it in: bbp_admin_reset_handler(), bbp_do_uninstall(), and bbp_version_updater(). Fixes bug where old bbPress role data could still exist in wp_user_roles`. See #2065. Fixes #2580.

Location:
trunk/src/includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/functions.php

    r5365 r5401  
    180180    switch_to_blog( $site_id );
    181181    bbp_delete_options();
     182    bbp_remove_roles();
    182183    bbp_remove_caps();
    183184    flush_rewrite_rules();
  • trunk/src/includes/admin/tools.php

    r5375 r5401  
    15491549
    15501550    $statement  = __( 'Deleting Roles and Capabilities… %s', 'bbpress' );
    1551     remove_role( bbp_get_moderator_role() );
    1552     remove_role( bbp_get_participant_role() );
     1551    bbp_remove_roles();
    15531552    bbp_remove_caps();
    15541553    $messages[] = sprintf( $statement, $success );
  • trunk/src/includes/core/capabilities.php

    r5064 r5401  
    512512}
    513513
    514 /** Deprecated ****************************************************************/
    515 
    516514/**
    517515 * Adds bbPress-specific user roles.
     
    525523
    526524/**
    527  * Removes bbPress-specific user roles.
     525 * Removes bbPress-specific user roles from the `wp_user_roles` array.
     526 *
     527 * This is currently only used when updating, uninstalling, or resetting bbPress.
     528 *
     529 * @see bbp_admin_reset_handler()
     530 * @see bbp_do_uninstall()
     531 * @see bbp_version_updater()
    528532 *
    529533 * @since bbPress (r2741)
    530  * @deprecated since version 2.2
    531534 */
    532535function bbp_remove_roles() {
  • trunk/src/includes/core/update.php

    r5133 r5401  
    269269    if ( $raw_db_version < 220 ) {
    270270
    271         // Remove the Moderator role from the database
    272         remove_role( bbp_get_moderator_role() );
    273 
    274         // Remove the Participant role from the database
    275         remove_role( bbp_get_participant_role() );
     271        // Remove any old bbPress roles
     272        bbp_remove_roles();
    276273
    277274        // Remove capabilities
Note: See TracChangeset for help on using the changeset viewer.