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

WordPress Trac noreply at wordpress.org
Sun Dec 4 17:29:22 UTC 2016

#38645: Improve roles reinit when switching between sites
 Reporter:  johnjamesjacoby          |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.8
Component:  Role/Capability          |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  multisite

Comment (by flixos90):

 [attachment:38645.diff] makes a few adjustments to the original patch and
 change `for_blog()` to `for_site()`.

 Since we're probably not going to do it (thus close #38681), I also
 created [attachment:38645.2.diff] which only includes the adjustments
 without the function renaming. As discussed on WCUS contributor day, we'll
 likely introduce `WP_Roles::for_blog()` to have parity with the existing
 `WP_User::for_blog()` instead of renaming the existing function, therefore
 the latter patch. Its changes:

 * do not remove the deprecated notice in `WP_Roles::reinit()`, but adjust
 it to point to `WP_Roles::for_blog()` (this was also causing a unit test
 to fail, but I think it makes sense to keep the method deprecated anyway)
 * clarify docs for `WP_Roles::for_blog()` a bit

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

More information about the wp-trac mailing list