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

WordPress Trac noreply at wordpress.org
Thu Oct 16 19:35:58 UTC 2025


#58001: Lazy load user capabilities in WP_User object
--------------------------------------------+------------------------------
 Reporter:  spacedmonkey                    |       Owner:  spacedmonkey
     Type:  enhancement                     |      Status:  assigned
 Priority:  normal                          |   Milestone:  6.9
Component:  Users                           |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  early needs-dev-note has-patch  |     Focuses:  multisite,
                                            |  performance
--------------------------------------------+------------------------------

Comment (by spacedmonkey):

 I put together [https://github.com/WordPress/wordpress-develop/pull/10309
 PR] that makes the caps, roles and allcaps properties again. The biggest
 issue this fixes, is loading user meta on the frontend. This new change,
 add a short_init option, that loads the user object, but skips loading
 roles, cap and allcaps. This is an opt-in feature and opt-in in a number
 of places in core. This stop user meta loading on the front end.

 The other downside, is the if you use the $authordata global, the
 properties will not be setup. This feel much more edge the current
 solution. But I will check the plugin repo.

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


More information about the wp-trac mailing list