As you saw already from URE code
global $wp_roles;
if (!isset($wp_roles)) {
$wp_roles = new WP_Roles();
}
if ($wp_roles->is_role($user_role_copy_from)) {
...
$wp_roles is not the simple stdClass object, it should be WP_Roles class from capabilities.php
If $wp_roles is not WP_Roles object, your blog roles set could be corrupted somehow…
Why you decided to rename Administrator role? URE uses that name directly to prohibit this critical role unauthorized changes. I’m not sure that WordPress itself doesn’t use ‘Administrator’ role name somewhere in the code. You should rename or delete ‘Administrator’ user. That’s critical for security reasons. But ‘Administrator’ role name is not your blog security related.
Thread Starter
mingya
(@mingya)
“Administrator” is the default admin role built in to wordpress. Renaming is simply the name that appears on the backend interface. not the actual role itself. I wiped out the whole db and reinstall, so corrupted role data is out of the picture.
I agree with you. Moreover as you do not try to add new role, code above is not executed at all. Can you show full error message from your site? Of course without real paths in it? It’s interesting for me to see PHP call stack trace.
Thread Starter
mingya
(@mingya)
Here is the error message. This line keeps repeating for every page query.
[07-May-2012 03:19:15] PHP Warning: array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The second argument, 'stdClass::is_role', should be a valid callback in /wp-includes/capabilities.php on line 676
I have the latest plugin installed v3.6.1
Thanks for the additional information. You get this error from line 676 of /wp-includes/capabilities.php, which belongs to function get_role_caps() and contains this code:
$this->roles = array_filter( array_keys( $this->caps ), array( &$wp_roles, 'is_role' ) );
for WordPress version 3.3.2
Conclusion:
1st: URE plugin doesn’t use this method – get_role_caps(). So I offer you to deactivate URE plugin for the moment and see – the error should be still there.
2nd: I placed breakpoint on this line at PHP debugger and check my test WordPress installation. This method was not called neither for front-end, neither for back-end for my set of plugins and default theme.
Thus, I suppose that some of other your installed plugins or theme uses it somehow. Please check not is_role() call, but get_role_caps(). May be you find something new information.