[wp-hackers] Display page only to admin..

Jordi Canals jcanals at alkivia.com
Sun May 17 20:21:21 GMT 2009


2009/5/17 madalin <niladam at gmail.com>:
> Thanks or your replies guys, but i decided to go with role-manager and
> took use of:
>
> if ( current_user_can('edit_plugins') ) {
> // my content
> }
>
> Hope this helps anyone :)
>

If you're checking for admin, I would better

if ( current_user_can('administrator') ) {
do_stuff();
}

Remember you can also ask for roles with current_user_can()
-- 
Jordi Canals [Txanny]
http://alkivia.org


More information about the wp-hackers mailing list