Advertisement
eventsmanager

Update to BinaryMoon's MS solution for timthumb image URLS

Apr 11th, 2012
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function get_image_path ($post_id = null) {
  2.     if ($post_id == null) {
  3.         global $post;
  4.         $post_id = $post->ID;
  5.     }
  6.     $theImageSrc = get_post_meta($post_id, 'Image', true);
  7.     if ( is_multisite() && $blog_id > 0) {
  8.         $imageParts = explode('/blogs.dir/', $theImageSrc );
  9.         if (isset($imageParts[1])) {
  10.             $theImageSrc = network_site_url('/wp-content/blogs.dir/' . $imageParts[1]);
  11.         }
  12.     }
  13.     return $theImageSrc;
  14. }
Advertisement
RAW Paste Data Copied
Advertisement