public function baseurl()
{
$uploads = $this->get_uploads_dir();
$base_url = (string) $uploads['baseurl'];
if (!is_subdomain_install()) {
return $base_url;
}
$site_url = get_option('siteurl');
if (0 === strpos($base_url, $site_url)) {
return $base_url;
}
return str_replace(parse_url($base_url, PHP_URL_HOST), parse_url($site_url, PHP_URL_HOST), $base_url);
}