Skip to content

Instantly share code, notes, and snippets.

@donaldG
Last active August 29, 2015 14:13
Show Gist options
  • Save donaldG/d382d6f5939029b94f4e to your computer and use it in GitHub Desktop.
Save donaldG/d382d6f5939029b94f4e to your computer and use it in GitHub Desktop.
<?php
function filter_image_url($url){
$liveurl = 'http://www.siteurl.com/';
$localurl = 'http://localhost/yourURL/';
$url = str_replace($localurl, $liveurl, $url);
return $url;
}
add_filter('wp_get_attachment_url', 'filter_image_url');
@aliciaduffy
Copy link

Don gaines so cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment