Support » Fixing WordPress » how to get admin url? get_site_url?

  • Resolved Rev. Voodoo

    (@rvoodoo)


    I have an uploader in my theme that had worked pretty good, however it has a hardcoded path I’d like to work on

    //If no errors registred, redirect back to the theme options panel
    	if(isset($_POST['Submit']) && !$errors)
    	{
    	$url = get_bloginfo('url') . '/empire/wp-admin/admin.php?page=functions.php';
    
    	header ("Location: $url");

    now obviously if I let anyone else use this theme, and they’re not installed in /empire, it won’t work

    I’ve been trying to figure this out and came across get_site_url

    Does it work for this? I see under scheme that admin is an option? Since I have no idea after reading the documentation, figured I’d ask!

    Does

    $url = get_bloginfo('url') . '/empire/wp-admin/admin.php?page=functions.php';

    Become something like:

    $url = get_site_url('', '', 'admin') . '?page=functions.php';

    or something like that?

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘how to get admin url? get_site_url?’ is closed to new replies.