[wp-hackers] User Capabilities

Ryan Boren ryan at boren.nu
Sun Jul 17 21:55:48 GMT 2005

On Thu, 2005-07-14 at 12:06 +0100, David House wrote:
> I think this is because WP_User::get_role_caps() is called from the
> WP_User constructor, but at this time, the user doesn't have any
> roles. The code in users.php to create a user looks like this:
> $user = new WP_User($user_ID);
> $user->set_role(get_settings('default_role'));
> Now, WP_User::get_role_caps() will be called from the first statement,
> but it's not until the second statement that the user gets a role set.
> The warnings were all warnings to do with variables not being arrays:
> foreach() and array_merge() were complaining. I'm pretty sure it's
> replicatable; just try to create a user through the admin interface.

Should be fixed now.


More information about the wp-hackers mailing list