Changeset 4591
- Timestamp:
- 12/20/2012 09:23:31 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/core/actions.php
r4579 r4591 91 91 92 92 /** 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 */ 106 98 add_action( 'bbp_setup_current_user', 'bbp_set_current_user_default_role' ); 107 99
Note: See TracChangeset
for help on using the changeset viewer.