Wordpress/tests
Felix Arntz 621a95a23f Multisite: Improve initializing available roles when switch sites.
Switching the available roles and the current user's capabilities no longer happens in `switch_to_blog()` and `restore_current_blog()`, instead it has been moved to a new function `wp_switch_roles_and_user()` which is hooked into the site switching process. This allows to improve performance by temporarily unhooking the function when roles and capabilities do not need to be switched.

This change ensures that switching available roles now works closer to switching user capabilities, particularly the changes in [41624]. A new `WP_Roles::for_site( $site_id )` method has been introduced, and the `WP_Roles::_init()` method has been deprecated. It is furthermore possible to retrieve the site ID for which the available roles are currently initialized through a new `WP_Roles::get_site_id()`.

Props johnjamesjacoby, flixos90.
Fixes #38645.


git-svn-id: https://develop.svn.wordpress.org/trunk@41625 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 21:43:59 +00:00
..
phpunit Multisite: Improve initializing available roles when switch sites. 2017-09-27 21:43:59 +00:00
qunit TinyMCE: disable the tests for `wptextpatterns` plugin in PhantomJS. 2017-09-27 16:21:24 +00:00