[wp-hackers] User Capabilities
Michael D Adams
mikea at turbonet.com
Wed Jul 13 18:00:56 GMT 2005
On Jul 12, 2005, at 8:55 AM, Ryan Boren wrote:
> Let the quibbling begin.
Currently $wp_roles is set essentially at the end of wp-
settings.php. This can cause problems for plugins using hooks that
have already been called by that point:
anything in wp_cache_postload()
(and anything in my-hacks.php)
And any others I missed (I just gave things a quick glance).
For example, Ryan's Preview Theme plugin calls get_currentuserinfo()
during the 'template' filter, and get_currentuserinfo() needs global
$wp_roles around when creating the new $current_user object.
How far up should $wp_roles go? Putting it straight after the
capabilities.php include doesn't *seem* to break anything, and there
are no hooks used before that point.
More information about the wp-hackers