[wp-trac] [WordPress Trac] #46440: WP_Roles data doesn't load correctly when 'switch_to_blog' is called in a multisite.

WordPress Trac noreply at wordpress.org
Fri Mar 8 03:07:08 UTC 2019


#46440: WP_Roles data doesn't load correctly when 'switch_to_blog' is called in a
multisite.
-----------------------------+-----------------------------
 Reporter:  syammohanm       |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  5.1
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 On `switch_to_blog` call, eventually it will come to `get_roles_data`
 method of `WP_Roles` through `switch_blog` hook. Then this method checks
 `is_multisite() && $this->site_id != get_current_blog_id()`, but
 `$this->site_id != get_current_blog_id()` will always be false, because
 the current blog id is already set in `switch_to_blog`, hence it fails to
 load the data.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46440>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list