Files
wordpress/wp-includes
spacedmonkey bf485c4bfe Users: Lazy load user capabilities in WP_User object.
Convert the WP_User object properties caps, roles, and allcaps to protected, and introduce lazy loading for capabilities. These properties are now populated only when first accessed.

The existing magic methods (__get, __set, and __unset) have been updated to maintain backward compatibility, ensuring that reading or modifying these formerly public properties continues to work as expected.

Ensure that these properties are initialised when calling remove_all_caps(), remove_cap(), has_cap(), add_role(), and set_role() methods.

Props spacedmonkey, flixos90, peterwilsoncc, mukesh27, westonruter, swissspidy, prettyboymp.
Fixes #58001.
Built from https://develop.svn.wordpress.org/trunk@60915


git-svn-id: http://core.svn.wordpress.org/trunk@60251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-08 20:01:35 +00:00
..