[wp-trac] [WordPress Trac] #58001: Lazy load user capabilities in WP_User object
WordPress Trac
noreply at wordpress.org
Wed Oct 15 18:17:16 UTC 2025
#58001: Lazy load user capabilities in WP_User object
----------------------------------+-------------------------------------
Reporter: spacedmonkey | Owner: flixos90
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.9
Component: Users | Version:
Severity: normal | Resolution:
Keywords: early needs-dev-note | Focuses: multisite, performance
----------------------------------+-------------------------------------
Comment (by spacedmonkey):
We already have other examples of where properties on this class have be
deprecated like in [18504].
I see no point on adding to caps, allcaps and roles properties on a class
instance. These changes would not presist, to do that, you need to call
`add_cap` and `add_role`. To get this data, there are methods like
`get_role_caps`.
If we revert this change, it will mean we have to make this as wontfix and
it also means that #63021 will not be possible.
Searching the plugin repo, there do seem to some examples, but not all
them seem to related to the WP_User object.
https://www.wpdirectory.net/search/01K7MH8A28VGSHHV41PVG891JE
https://www.wpdirectory.net/search/01K7MHBCP874AFAMPQXZ5T68VE
https://www.wpdirectory.net/search/01K7MHCEJ4CEF3WQNV52CGSAD8
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58001#comment:45>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list