[wp-trac] [WordPress Trac] #38645: Improve roles reinit when switching between sites

WordPress Trac noreply at wordpress.org
Wed Sep 27 21:34:30 UTC 2017


#38645: Improve roles reinit when switching between sites
-------------------------------------------------+-------------------------
 Reporter:  johnjamesjacoby                      |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  4.9
Component:  Role/Capability                      |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:  multisite
  note                                           |
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests needs-
     dev-note


Comment:

 Similar to the suggestions in #36961 for the `WP_User` class,
 [attachment:38645.6.diff] introduces a `WP_Roles::get_site_id()` method to
 allow retrieving the ID of the site for which roles are currently
 initialized. Additional tests have been added to verify the new method
 works correctly, and an extra `is_multisite()` check has been added in
 `WP_Roles::get_roles_data()` to make sure that the `get_blog_option()`
 function is not called when not in multisite.

 Adding `needs-dev-note` because of the deprecated `WP_Roles::_init()`
 method.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38645#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list