Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#44894 assigned enhancement

Add support for an optional `$roles` parameter to `populate_roles()`

Reported by: flixos90's profile flixos90 Owned by: flixos90's profile flixos90
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: needs-patch needs-unit-tests
Focuses: multisite Cc:

Description

It should be possible to provide custom roles (and capabilities) to populate_roles() when populating a new site with its roles. This came up during work on #41333.

Change History (4)

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


6 years ago

#2 @flixos90
6 years ago

  • Milestone changed from 5.0 to Future Release

Since it was agreed on that implementation of this would be rather complex to get it right (particularly because extra roles are typically added by plugins, and those only work on the current site unless network-active), let's move this to a TBD milestone.

#41333 does not provide support for this for the same reason.

#3 follow-up: @boonebgorges
6 years ago

Not sure if this counts as part of the proposed changes, but I noticed recently that populate_roles() can generate many dozens of consecutive database writes, which can wreak havoc in certain environments. I wonder if we might consider setting use_db = false at the beginning of the populate process, and then doing a single save at the end.

#4 in reply to: ↑ 3 @ocean90
6 years ago

Replying to boonebgorges:

I noticed recently that populate_roles() can generate many dozens of consecutive database writes

See #37687.

Note: See TracTickets for help on using tickets.