// 2011.07.14: [get_media_link query="ID (attachment_id) " format=""] // Wordpressのメディアへのリンク情報を使う // For Media manageger // Parse parameters extract(shortcode_atts(array('query' => '', 'format' => ''), $atts)); // Decode all html tags to raw and delete all html tags. And then, escape data. $query = attribute_escape(strip_tags(html_entity_decode($query,ENT_QUOTES))); $format = attribute_escape(strip_tags(html_entity_decode($format,ENT_QUOTES))); if (empty($query)) return ''; $c_post = get_post($query); // Delete Javascript Code (XSS) $link = clean_url(wp_get_attachment_url($c_post->ID)); $image = wp_get_attachment_image_src($c_post->ID, 'thumbnail'); $alt = attribute_escape($c_post->post_excerpt); $desc = attribute_escape($c_post->post_content); if ($link){ if($format == "download") echo $link; else{ echo '' . $alt . ''; } }