Created
March 27, 2012 20:18
-
-
Save joshellington/2219927 to your computer and use it in GitHub Desktop.
wordpress image path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_image_path($img_src) { | |
global $blog_id; | |
if (isset($blog_id) && $blog_id > 0) { | |
$imageParts = explode('/files/', $img_src); | |
if (isset($imageParts[1])) { | |
$img_src = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1]; | |
}else {return $imageParts ;} | |
} | |
return $img_src; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment