<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multiple Media Uploads in WordPress&#8217; Functions.php</title>
	<atom:link href="http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/</link>
	<description>Web Design, WordPress/Drupal blog design &#38; theming, SEO, css. xhtml, php, coldfusion, jquery and more...</description>
	<lastBuildDate>Fri, 03 Feb 2012 06:21:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Justin W Hall</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-185646</link>
		<dc:creator>Justin W Hall</dc:creator>
		<pubDate>Tue, 31 Jan 2012 15:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-185646</guid>
		<description>You can find it here:

http://www.justinwhall.com/multiple-upload-inputs-in-a-wordpress-theme-options-page/</description>
		<content:encoded><![CDATA[<p>You can find it here:</p>
<p><a href="http://www.justinwhall.com/multiple-upload-inputs-in-a-wordpress-theme-options-page/" rel="nofollow">http://www.justinwhall.com/multiple-upload-inputs-in-a-wordpress-theme-options-page/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SP007</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-185629</link>
		<dc:creator>SP007</dc:creator>
		<pubDate>Tue, 31 Jan 2012 06:55:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-185629</guid>
		<description>Can any one provide me the full source code</description>
		<content:encoded><![CDATA[<p>Can any one provide me the full source code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin W Hall</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-185331</link>
		<dc:creator>Justin W Hall</dc:creator>
		<pubDate>Thu, 26 Jan 2012 15:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-185331</guid>
		<description>Um, &quot;altered code&quot; is exactly the same...  On the other had, I did pretty much exactly what @Ethan Hackett did. That works great.</description>
		<content:encoded><![CDATA[<p>Um, &#8220;altered code&#8221; is exactly the same&#8230;  On the other had, I did pretty much exactly what @Ethan Hackett did. That works great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Plugin para subir imágenes en un campo personalizado de Wordpress</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-181515</link>
		<dc:creator>Plugin para subir imágenes en un campo personalizado de Wordpress</dc:creator>
		<pubDate>Mon, 12 Dec 2011 07:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-181515</guid>
		<description>[...] que me han servido de fuente, como estos: - Using the WordPress Uploader in Your Plugin or Theme - Multiple Media Uploads in WordPress’ Functions.php - Y sobre todo la ayuda del gran libro Professional WordPress Plugin DevelopmentVamos a crear dos [...]</description>
		<content:encoded><![CDATA[<p>[...] que me han servido de fuente, como estos: &#8211; Using the WordPress Uploader in Your Plugin or Theme &#8211; Multiple Media Uploads in WordPress’ Functions.php &#8211; Y sobre todo la ayuda del gran libro Professional WordPress Plugin DevelopmentVamos a crear dos [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [WordPress]Using the media browser in your plugin &#124; Tiny Threads</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-175335</link>
		<dc:creator>[WordPress]Using the media browser in your plugin &#124; Tiny Threads</dc:creator>
		<pubDate>Sat, 27 Aug 2011 01:00:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-175335</guid>
		<description>[...] Rich from The English Guy Web Design. He adapted the same code for use with multiple entries on a single page. That was exactly what I [...]</description>
		<content:encoded><![CDATA[<p>[...] Rich from The English Guy Web Design. He adapted the same code for use with multiple entries on a single page. That was exactly what I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ethan Hackett</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-174692</link>
		<dc:creator>Ethan Hackett</dc:creator>
		<pubDate>Thu, 11 Aug 2011 20:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-174692</guid>
		<description>&lt;code&gt;
jQuery(document).ready(function() {

// I changed the trigger to a class.   			
jQuery(&#039;.image_uploader_button&#039;).click(function() {
	 // I switched the id for the this-prev selector that sends the name
	 	of the input field that proceeds it.
	 formfield = jQuery(this).prev().attr(&#039;name&#039;);
	 tb_show(&#039;&#039;, &#039;media-upload.php?type=image&amp;TB_iframe=true&#039;);
	 return false;
});

window.send_to_editor = function(html) {
	 imgurl = jQuery(&#039;img&#039;,html).attr(&#039;src&#039;);
	 // I then called the name and joined with # for the id.
	 jQuery(&quot;#&quot;+formfield).val(imgurl);
	 tb_remove();
}

});
&lt;/code&gt;

Now I can run as many image uploads on the page as I want.</description>
		<content:encoded><![CDATA[<p><code><br />
jQuery(document).ready(function() {</p>
<p>// I changed the trigger to a class.<br />
jQuery('.image_uploader_button').click(function() {<br />
	 // I switched the id for the this-prev selector that sends the name<br />
	 	of the input field that proceeds it.<br />
	 formfield = jQuery(this).prev().attr('name');<br />
	 tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');<br />
	 return false;<br />
});</p>
<p>window.send_to_editor = function(html) {<br />
	 imgurl = jQuery('img',html).attr('src');<br />
	 // I then called the name and joined with # for the id.<br />
	 jQuery("#"+formfield).val(imgurl);<br />
	 tb_remove();<br />
}</p>
<p>});<br />
</code></p>
<p>Now I can run as many image uploads on the page as I want.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-171600</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Tue, 07 Jun 2011 23:30:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-171600</guid>
		<description>The HTML part... 

 &lt;table&gt;
  &lt;tr valign=&quot;top&quot;&gt;
&lt;th scope=&quot;row&quot;&gt;Upload Image 1&lt;/th&gt;
&lt;td&gt;&lt;label for=&quot;image1&quot;&gt;
&lt;input id=image1&quot; type=&quot;text&quot; size=&quot;36&quot; name=&quot;image1&quot; value=&quot;&quot; /&gt;
&lt;input class=&quot;upload_image_button&quot; type=&quot;button&quot; value=&quot;Browse..&quot; /&gt;
&lt;br /&gt;Enter an URL or upload image1
&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
  &lt;tr valign=&quot;top&quot;&gt;
&lt;th scope=&quot;row&quot;&gt;Upload Image 2&lt;/th&gt;
&lt;/td&gt;
&lt;td&gt;&lt;label for=&quot;image2&quot;&gt;
&lt;input id=&quot;image2&quot; type=&quot;text&quot; size=&quot;36&quot; name=&quot;image2&quot; value=&quot;&quot; /&gt;
&lt;input class=&quot;upload_image_button&quot; type=&quot;button&quot; value=&quot;Sfoglia...&quot; /&gt;
&lt;br /&gt;Enter an URL or upload image2
&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</description>
		<content:encoded><![CDATA[<p>The HTML part&#8230; </p>
<p> &lt;table&gt;<br />
  &lt;tr valign=&quot;top&quot;&gt;<br />
&lt;th scope=&quot;row&quot;&gt;Upload Image 1&lt;/th&gt;<br />
&lt;td&gt;&lt;label for=&quot;image1&quot;&gt;<br />
&lt;input id=image1&quot; type=&quot;text&quot; size=&quot;36&quot; name=&quot;image1&quot; value=&quot;&quot; /&gt;<br />
&lt;input class=&quot;upload_image_button&quot; type=&quot;button&quot; value=&quot;Browse..&quot; /&gt;<br />
&lt;br /&gt;Enter an URL or upload image1<br />
&lt;/label&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
  &lt;tr valign=&quot;top&quot;&gt;<br />
&lt;th scope=&quot;row&quot;&gt;Upload Image 2&lt;/th&gt;<br />
&lt;/td&gt;<br />
&lt;td&gt;&lt;label for=&quot;image2&quot;&gt;<br />
&lt;input id=&quot;image2&quot; type=&quot;text&quot; size=&quot;36&quot; name=&quot;image2&quot; value=&quot;&quot; /&gt;<br />
&lt;input class=&quot;upload_image_button&quot; type=&quot;button&quot; value=&quot;Sfoglia&#8230;&quot; /&gt;<br />
&lt;br /&gt;Enter an URL or upload image2<br />
&lt;/label&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-171598</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Tue, 07 Jun 2011 23:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-171598</guid>
		<description>Multiple forms (2 in this case) using class selector, no need of coding multiple listeners, HTML could be dinamically generated while the script remains the same.

AND function proxying..so we keep original functionality of media-upload.php in case we just want to upload an image into the content of the post.

The HTML:



Upload Image 1



Enter an URL or upload 1st image




  
Upload Image 2




Enter an URL or upload 2nd image




The JS:

jQuery(document).ready(function() {

var formlabel = 0;
var old_send_to_editor = window.send_to_editor;
var old_tb_remove = window.tb_remove;

jQuery(&#039;.upload_image_button&#039;).click(function(){
	formlabel = jQuery(this).parent();
 	tb_show(&#039;&#039;, &#039;media-upload.php?type=image&amp;TB_iframe=true&#039;);
	return false;
});

window.tb_remove = function() {
       formlabel = 0;
       old_tb_remove();
}

window.send_to_editor = function(html) {
 if(formlabel){
  imgurl = jQuery(&#039;img&#039;,html).attr(&#039;src&#039;);
  formlabel.find(&#039;input[type=text]&#039;).value(imgurl);
  tb_remove();
 } else {
   old_send_to_editor
 }
}

});

Works ok!
Enjoy!</description>
		<content:encoded><![CDATA[<p>Multiple forms (2 in this case) using class selector, no need of coding multiple listeners, HTML could be dinamically generated while the script remains the same.</p>
<p>AND function proxying..so we keep original functionality of media-upload.php in case we just want to upload an image into the content of the post.</p>
<p>The HTML:</p>
<p>Upload Image 1</p>
<p>Enter an URL or upload 1st image</p>
<p>Upload Image 2</p>
<p>Enter an URL or upload 2nd image</p>
<p>The JS:</p>
<p>jQuery(document).ready(function() {</p>
<p>var formlabel = 0;<br />
var old_send_to_editor = window.send_to_editor;<br />
var old_tb_remove = window.tb_remove;</p>
<p>jQuery(&#8216;.upload_image_button&#8217;).click(function(){<br />
	formlabel = jQuery(this).parent();<br />
 	tb_show(&#8221;, &#8216;media-upload.php?type=image&amp;TB_iframe=true&#8217;);<br />
	return false;<br />
});</p>
<p>window.tb_remove = function() {<br />
       formlabel = 0;<br />
       old_tb_remove();<br />
}</p>
<p>window.send_to_editor = function(html) {<br />
 if(formlabel){<br />
  imgurl = jQuery(&#8216;img&#8217;,html).attr(&#8216;src&#8217;);<br />
  formlabel.find(&#8216;input[type=text]&#8216;).value(imgurl);<br />
  tb_remove();<br />
 } else {<br />
   old_send_to_editor<br />
 }<br />
}</p>
<p>});</p>
<p>Works ok!<br />
Enjoy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ebe</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-161807</link>
		<dc:creator>ebe</dc:creator>
		<pubDate>Thu, 20 Jan 2011 23:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-161807</guid>
		<description>well i am not a jquery expert and had the need to upload many images in same file, i found a workaround not the best but it works, hope a jquery guru can do it better. Call the onclick event in button and pass the input id and walla! cheers.

function uploaderWeb(container){
	
		formfield = jQuery(&#039;#&#039;+container).attr(&#039;name&#039;);
		tb_show(&#039;&#039;, &#039;media-upload.php?type=image&amp;TB_iframe=true&#039;);
		//return false;
	
	window.send_to_editor = function(html){
		imgurl = jQuery(&#039;img&#039;, html).attr(&#039;src&#039;);
		jQuery(&#039;#&#039;+container).val(imgurl);
		tb_remove();
	}

}</description>
		<content:encoded><![CDATA[<p>well i am not a jquery expert and had the need to upload many images in same file, i found a workaround not the best but it works, hope a jquery guru can do it better. Call the onclick event in button and pass the input id and walla! cheers.</p>
<p>function uploaderWeb(container){</p>
<p>		formfield = jQuery(&#8216;#&#8217;+container).attr(&#8216;name&#8217;);<br />
		tb_show(&#8221;, &#8216;media-upload.php?type=image&amp;TB_iframe=true&#8217;);<br />
		//return false;</p>
<p>	window.send_to_editor = function(html){<br />
		imgurl = jQuery(&#8216;img&#8217;, html).attr(&#8216;src&#8217;);<br />
		jQuery(&#8216;#&#8217;+container).val(imgurl);<br />
		tb_remove();<br />
	}</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hank</title>
		<link>http://www.theenglishguy.co.uk/2010/01/24/multiple-media-uploads-in-wordpress-functions-php/comment-page-1/#comment-158028</link>
		<dc:creator>Hank</dc:creator>
		<pubDate>Thu, 09 Dec 2010 23:41:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.theenglishguy.co.uk/?p=1946#comment-158028</guid>
		<description>has anyone figured this out yet - looks like there is still identical code in the two functions...</description>
		<content:encoded><![CDATA[<p>has anyone figured this out yet &#8211; looks like there is still identical code in the two functions&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

