[wp-hackers] checking for user logged in a plugin

Mika A Epstein ipstenu at ipstenu.org
Fri Apr 27 13:58:12 UTC 2012


Try

if ( (is_user_logged_in() ) && (current_user_can('administrator')) ) { ....


----
Mika A Epstein (aka Ipstenu)
http://ipstenu.org

On 27 Apr 2012, at 8:41:43AM, Chris McCoy wrote:

> Im doing this in a plugin
> 
> if(is_user_logged_in() && current_user_can('administrator')) {
>        add_filter('stylesheet', 'admin_role_theme');
>        add_filter('template', 'admin_role_theme');
> }
> 
> But fires is_user_logged_in not defined, should I be firing this a diferent
> way.
> 
> It basically selects the theme for admin only so he can work on a different
> design live.
> 
> 
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list