Skip to:
Content

bbPress.org

Changeset 4591


Ignore:
Timestamp:
12/20/2012 09:23:31 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Remove 'switch_blog' hook for bbp_set_current_user_default_role(). Causing issues with multisite creation. Fixes #2103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/actions.php

    r4579 r4591  
    9191
    9292/**
    93  * When switching to a new blog, a users mapped role will get wiped out by
    94  * WP_User::for_blog() and WP_User::_init_caps().
    95  *
    96  * This happens naturally in multisite setups during WP_Admin_Bar::initialize(),
    97  * which is annoying because it will happen on each page-load.
    98  *
    99  * Resetting the role on blog-switch enables us to maintain the user's dynamic
    100  * role between sites. Note that if a user already has a role on that site, no
    101  * mapping will occur.
    102  *
    103  * We also hook to 'bbp_setup_current_user' -- naturally.
    104  */
    105 add_action( 'switch_blog',            'bbp_set_current_user_default_role' );
     93 * When setting up the current user, make sure they have a role for the forums.
     94 *
     95 * This is multisite aware, thanks to bbp_filter_user_roles_option(), hooked to
     96 * the 'bbp_loaded' action above.
     97 */
    10698add_action( 'bbp_setup_current_user', 'bbp_set_current_user_default_role' );
    10799
Note: See TracChangeset for help on using the changeset viewer.