function wpt_store_url($post_ID, $url)
 {
     if (function_exists('jd_shorten_link')) {
         $shortener = get_option('jd_shortener');
         switch ($shortener) {
             case 0:
             case 1:
             case 4:
                 $ext = '_wp';
                 break;
             case 2:
                 $ext = '_bitly';
                 break;
             case 3:
                 $ext = '_url';
                 break;
             case 5:
             case 6:
                 $ext = '_yourls';
                 break;
             case 7:
                 $ext = '_supr';
                 break;
             case 8:
                 $ext = '_goo';
                 break;
             case 9:
                 $ext = '_tfl';
                 break;
             case 10:
                 $ext = '_joturl';
                 break;
             default:
                 $ext = '_ind';
         }
         if (get_post_meta($post_ID, "_wp_jd{$ext}", TRUE) != $url) {
             update_post_meta($post_ID, "_wp_jd{$ext}", $url);
         }
         switch ($shortener) {
             case 0:
             case 1:
             case 2:
             case 7:
             case 8:
                 $target = jd_expand_url($url);
                 break;
             case 5:
             case 6:
                 $target = jd_expand_yourl($url, $shortener);
                 break;
             case 9:
                 $target = $url;
             default:
                 $target = $url;
         }
     } else {
         $target = $url;
     }
     update_post_meta($post_ID, '_wp_jd_target', $target);
 }
 function wpt_store_url($post_ID, $url)
 {
     $store_urls = apply_filters('wpt_store_urls', true, $post_ID, $url);
     if (function_exists('jd_shorten_link') && $store_urls) {
         $shortener = get_option('jd_shortener');
         if (get_post_meta($post_ID, '_wpt_short_url', true) != $url) {
             update_post_meta($post_ID, '_wpt_short_url', $url);
         }
         switch ($shortener) {
             case 0:
             case 1:
             case 2:
             case 7:
             case 8:
                 $target = jd_expand_url($url);
                 break;
             case 5:
             case 6:
                 $target = jd_expand_yourl($url, $shortener);
                 break;
             default:
                 $target = $url;
         }
     } else {
         $target = $url;
     }
     update_post_meta($post_ID, '_wp_jd_target', $target);
 }