[wp-hackers] Problems with reference to $wp_roles->roles
David F. Carr
david at carrcommunications.com
Fri Feb 10 15:23:04 UTC 2012
I found that every reference to $wp_roles in WordPress core was wrapped
with an isset check, so I just needed to do the same:
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
On Thu, Feb 9, 2012 at 5:41 PM, Jeremy Clarke <jer at simianuprising.com>wrote:
> I'm not sure why the $wp_roles object would be unnavailable sometimes, but
> maybe your users are seeing errors you aren't because they have error
> reporting in PHP turned up higher than you.
>
> If you aren't already, you should enable WP_DEBUG and the Debug Bar plugin
> and use them when developing. WP_DEBUG will make you see as many errors as
> possible and the Debug Bar plugin will give you a nice button that lights
> up orange when there is a warning or notice anywhere on the page, useful
> when the errors aren't in places you commonly look.
>
> You should also enable WP_DEBUG_LOG, which will write all errors to a
> /wp-content/debug.log file. Tail that file (using command line, or the
> Console app on OSX) to catch ALL the errors, even ones that happen behind
> the scenes in AJAX calls.
>
> Learn all about it on my favorite site on the internet:
> http://codex.wordpress.org/Debugging_in_WordPress
>
> --
> Jeremy Clarke • jeremyclarke.org
> Code and Design • globalvoicesonline.org
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
David F. Carr
Writer, Editor, Web Consultant
david at carrcommunications.com
http://www.carrcommunications.com/
Direct: (954) 757-5827
Mobile: (954) 290-6788
Fax: (877) 798-7706
Editor, The BrainYard http://www.informationweek.com/thebrainyard
LinkedIn - http://www.linkedin.com/in/davidfcarr
Facebook - http://www.facebook.com/carrcomm
David F. Carr
971 NW 124 Ave.
Coral Springs FL 33071-5082
More information about the wp-hackers
mailing list