wp_guess_url() and install styling fixes from sambauers. fixes #7129 see #4732

git-svn-id: http://svn.automattic.com/wordpress/trunk@8182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-06-24 17:36:21 +00:00
parent c64c4fbd63
commit ce2ed91698
4 changed files with 19 additions and 11 deletions

View File

@@ -2126,4 +2126,14 @@ function force_ssl_admin($force = '') {
return $forced;
}
function wp_guess_url() {
if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
$url = WP_SITEURL;
} else {
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
$url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
return $url;
}
?>