Definition:
function wp_guess_url() {}
Guess the URL for the site.
Will remove wp-admin links to retrieve only return URLs not in the wp-admin directory.
Source code
function wp_guess_url() {
if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
$url = WP_SITEURL;
} else {
$schema = is_ssl() ? 'https://' : 'http://';
$url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
return rtrim($url, '/');
}
3753

February 12, 2011 


No comments yet... Be the first to leave a reply!