Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#46440 new defect (bug)

WP_Roles data doesn't load correctly when 'switch_to_blog' is called in a multisite.

Reported by: syammohanm's profile syammohanm Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.1
Component: Role/Capability Keywords:
Focuses: multisite Cc:

Description

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.

Change History (2)

#1 @jeremyfelt
6 years ago

  • Focuses multisite added

Thanks for the ticket, @syammohanm! I haven't taken a close look yet, but I'll add some tags that may help with visibility.

Related: #38645, #36961.

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.