[wp-trac] [WordPress Trac] #58001: Lazy load user capabilities in WP_User object

WordPress Trac noreply at wordpress.org
Thu Oct 9 21:27:34 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 TimothyBlynJacobs):

 > I am not sure what you mean here. WP_User::to_array() looks like this

 Yep, my mistake. Apologies for the confusion.

 > that you would use that function and get those properties

 I think it's less folks doing specifically `get_object_vars( $user
 )['allcaps']` all in one go. But more the User object being moved around
 or serialized into a plain object.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58001#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list