Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #38645


Ignore:
Timestamp:
11/03/2016 06:15:44 PM (8 years ago)
Author:
johnjamesjacoby
Comment:

(Edited typos and added a missing word.)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38645 – Description

    initial v1  
    33The current regression means if a plugin was keeping its own copy of the `$wp_roles` global around (maybe as a property in a class, or for some other convenience sake) then then newly created `$wp_roles` global no longer points to that same copy. (See #23016 for more details & examples.)
    44
    5 History lesson: previous to that changeset, the `reinit()` method was used to update the roles for the witched site. That method was largely a copy of the `_init()` method, and was purpose built for blog switching.
     5History lesson: previous to that changeset, the `reinit()` method was used to update the roles for the switched site. That method was largely a copy of the `_init()` method, and was purpose built for blog switching.
    66
    77----
     
    1111We can take inspiration from the `WP_User::for_blog()` method, and introduce a `for_blog()` method to the `WP_Roles` class to basically do the exact same thing in the exact same way. We can make alterations to the blog switching functions to update the `$wp_roles` and `$current_user->roles` values in unison.
    1212
    13 Architecturally, I think it makes sense to call these methods together, but not have one call the other all the time, because there may a reason or time where that control is welcome, and marrying them together now makes divorcing them later difficult.
     13Architecturally, I think it makes sense to call these methods together, but not have one call the other all the time, because there may be a reason or time where that control is welcome, and marrying them together now makes divorcing them later difficult.
    1414
    1515Patch imminent.