WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 7 months ago

#46440 new defect (bug)

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

Reported by: 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
7 months 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.


7 months ago

Note: See TracTickets for help on using tickets.