[wp-hackers] Admin Action Prior to Headers

Jamie Holly hovercrafter at earthlink.net
Sun Jun 24 16:46:09 GMT 2007


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jamie Holly wrote:
> >>> On 6/23/07, Bill Smith <ml_wordpress at copperleaf.org> wrote:
> >>>> If I have to do it with init or
> >>>> plugins_loaded, is there a clean way to identify that it's an
> admin
> >> page
> >>>> being loaded?
> >
> > If your wanting to see if the person is an admin then do the
> is_admin() like other's have suggested. If you are wanting to see if
> the page being served is from the admin section, then you could always
> check the request url, something like:
> >
> 
> Incorrect. is_admin means that you are on a page within wp-admin not
> that you are the admin user.
> 
> >
> > if (strstr($_SERVER['REQUEST_URI'],"/wp-admin/")) {
> > 	[....do the admin section only stuff here...]
> > }
> >
> 
> This check just repeats what is_admin already does.
> 
> westi
> - --
> Peter Westwood
> http://blog.ftwr.co.uk


DOH! You're right. I was thinking of the Drupal is_admin global.



More information about the wp-hackers mailing list