[wp-hackers] Current Dashboard URL/URI?

Otto otto at ottodestruct.com
Mon Apr 23 23:55:40 UTC 2012


That's basically correct, although I'd do it this way:

global $pagenow;
$url = admin_url($pagenow.'?'.$_SERVER['QUERY_STRING']);

-Otto


On Mon, Apr 23, 2012 at 4:05 PM, Mike Walsh <mpwalsh8 at gmail.com> wrote:
> What is the recommended method for reconstructing the current URL on the
> Dashboard?  I need this in my plugin to construct a link.  I am currently
> using the this:
>
> $url = get_admin_url() . $pagenow . '?' . $_SERVER['QUERY_STRING'] ;
>
> Is there a better solution?  I couldn't find a WordPress function to return
> the query string or the full URL.
>
> Thanks,
>
> Mike
>
> --
> Mike Walsh - mpwalsh8 at gmail.com
> _______________________________________________
> 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