public static function prepend_to_url($url, $path)
{
if (strstr(strtolower($url), 'http')) {
$url_parts = parse_url($url);
$url = $url_parts['scheme'] . '://' . $url_parts['host'] . $path . $url_parts['path'];
if (isset($url_parts['query'])) {
$url .= $url_parts['query'];
}
if (isset($url_parts['fragment'])) {
$url .= $url_parts['fragment'];
}
} else {
$url = $url . $path;
}
return self::remove_double_slashes($url);
}
/** * @internal * @param string $url * @param string $text * @return mixed */ protected function get_archives_link($url, $text) { $ret = array(); $ret['text'] = $ret['title'] = $ret['name'] = wptexturize($text); $ret['url'] = $ret['link'] = esc_url(URLHelper::prepend_to_url($url, $this->base)); return $ret; }