function pugpig_wp_get_attachment_url($url)
{
    $absoluteprefix = pugpig_get_root();
    if (startsWith($url, $absoluteprefix)) {
        return $url;
    }
    if (!empty($url)) {
        $url = pugpig_strip_domain($url);
    }
    return $url;
}
function pugpig_rewrite_content($content)
{
    // This is no longer required as the link to the manifest is in the ATOM feed
    // $id = 'post-' . get_the_ID() . ".manifest";
    // $manifest = pugpig_path_to_rel_url(PUGPIG_MANIFESTPATH . $id);
    // $pattern = '/<html/i';
    // $content = preg_replace($pattern,'<html manifest="' . $manifest . '"',$content);
    // TODO: Need to make this less aggresive - we want absolute URLs for non html cases
    //if (strpos($content, '<html') !== FALSE) {
    $absoluteprefix = pugpig_get_root();
    $content = str_replace($absoluteprefix, '', $content);
    // $content = str_replace(" site", " Puggers site", $content);
    //}
    $content = pugpig_rewrite_wpcontent_links($content);
    return $content;
}