<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webmaster-Source &#187; Plugins</title>
	<atom:link href="https://www.webmaster-source.com/tag/plugins/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.webmaster-source.com</link>
	<description>Useful Resources For Webmasters</description>
	<lastBuildDate>Thu, 24 Aug 2017 02:01:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Using the WordPress 3.5 Media Uploader in Your Plugin or Theme</title>
		<link>https://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/</link>
		<comments>https://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 11:21:50 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Themes]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=5001</guid>
		<description><![CDATA[Back in 2010, I wrote a post on Using the WordPress Uploader in Your Plugin or Theme that went on to be one of my most popular tutorials of all time. Then the WordPress team went and added a much cooler media uploader in version 3.5 and make that post outdated. Since most of you [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Back in 2010, I wrote a post on <a href="http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/">Using the WordPress Uploader in Your Plugin or Theme</a> that went on to be one of my most popular tutorials of all time. Then the WordPress team went and added a much cooler media uploader in version 3.5 and make that post outdated. Since most of you probably want to add the <em>new</em> uploader in a theme or plugin you&#8217;re working on right now, I figured it was time for an updated post.</p>
<p style="text-align: center"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-5002 imgborder" alt="WordPress 3.5 Media Uploader" src="//www.webmaster-source.com/wp-content/uploads/2013/02/wp35mediauploader.png" width="600" height="286" /></p>
<p>The process required to add the new uploader is a bit different, but not too much more difficult. I was able to adapt the old tutorial a little, so it shouldn&#8217;t be too hard to replace some code in an existing project and get the new uploader instead of the old.<span id="more-5001"></span></p>
<p>For the sake of simplicity, let&#8217;s start with the same HTML snippet as in the old tutorial. This goes along with the rest of the HTML for your admin page, or wherever in the admin you&#8217;re trying to add an upload field.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;label for=&quot;upload_image&quot;&gt;
	&lt;input id=&quot;upload_image&quot; type=&quot;text&quot; size=&quot;36&quot; name=&quot;ad_image&quot; value=&quot;http://&quot; /&gt; 
	&lt;input id=&quot;upload_image_button&quot; class=&quot;button&quot; type=&quot;button&quot; value=&quot;Upload Image&quot; /&gt;
	&lt;br /&gt;Enter a URL or upload an image
&lt;/label&gt;
</pre>
<p>Now we need to load up the necessary JavaScript files.</p>
<pre class="brush: php; title: ; notranslate">
add_action('admin_enqueue_scripts', 'my_admin_scripts');

function my_admin_scripts() {
	if (isset($_GET['page']) &amp;&amp; $_GET['page'] == 'my_plugin_page') {
		wp_enqueue_media();
		wp_register_script('my-admin-js', WP_PLUGIN_URL.'/my-plugin/my-admin.js', array('jquery'));
		wp_enqueue_script('my-admin-js');
	}
}
</pre>
<p>We bind the <code>my_admin_scripts()</code> function to the <code>admin_enqueue_scripts</code> hook, and enqueue both the media scripts and our own JavaScript file. Also, the scripts will only be loaded if the current page is equal to &#8220;my_plugin_page,&#8221; which you would of course replace with the slug your <a href="http://codex.wordpress.org/Administration_Menus">admin menu</a> has.</p>
<p>Now for the complicated part: the script that hooks into the uploader. Continuing with the above example, it would be named <code>my-admin.js</code>.</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery(document).ready(function($){


	var custom_uploader;


	$('#upload_image_button').click(function(e) {

		e.preventDefault();

		//If the uploader object has already been created, reopen the dialog
		if (custom_uploader) {
			custom_uploader.open();
			return;
		}

		//Extend the wp.media object
		custom_uploader = wp.media.frames.file_frame = wp.media({
			title: 'Choose Image',
			button: {
				text: 'Choose Image'
			},
			multiple: false
		});

		//When a file is selected, grab the URL and set it as the text field's value
		custom_uploader.on('select', function() {
			attachment = custom_uploader.state().get('selection').first().toJSON();
			$('#upload_image').val(attachment.url);
		});

		//Open the uploader dialog
		custom_uploader.open();

	});


});
</pre>
<p>When the button is clicked, it creates a new instance of the <code>wp.media</code> object and configures it to only accept a single file, since the text field can only hold one file URL. Then it binds a function to the selection action, which gets the file attributes when an image is chosen and sets the <code>#upload_image</code> text field value to the file&#8217;s URL.</p>
<p>Providing everything went as expected, you should have a form field that will accept an arbitrary URL, or allow the user to upload one.</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  src="//www.webmaster-source.com/wp-content/uploads/2013/02/wp35mediauploader-field.png" alt="File Upload Field" width="352" height="44" class="aligncenter size-full wp-image-5005" /></p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/feed/</wfw:commentRss>
		<slash:comments>70</slash:comments>
		</item>
		<item>
		<title>WordPress Core Control</title>
		<link>https://www.webmaster-source.com/2013/01/16/wordpress-core-control/</link>
		<comments>https://www.webmaster-source.com/2013/01/16/wordpress-core-control/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 11:44:33 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4974</guid>
		<description><![CDATA[I&#8217;ve been working on a WordPress plugin that takes advantage of the WP-Cron system (which, for the uninitiated, is a sort of event scheduling system that runs functions in WordPress at predetermined intervals). Unfortunately, that&#8217;s a bit of a pain considering the nature of the task. How do you test functions that are designed to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on a WordPress plugin that takes advantage of the <a href="http://wp.tutsplus.com/tutorials/theme-development/do-it-yourself-wordpress-scheduling-mastering-wp-cron/">WP-Cron</a> system (which, for the uninitiated, is a sort of event scheduling system that runs functions in WordPress at predetermined intervals). Unfortunately, that&#8217;s a bit of a pain considering the nature of the task. How do you test functions that are designed to run intermittently, say twice a day? The easy/hacky solution is to add a function call that runs the task on every page load, and then remove it when you&#8217;re done. But if you want a solution that doesn&#8217;t involve editing your code, there&#8217;s a handy plugin that&#8217;s perfect for this scenario.</p>
<p><a href="http://wordpress.org/extend/plugins/core-control/">Core Control</a> is a plugin that lets you monitor and adjust several parts of WordPress for diagnostic and development purposes. It makes it easy to view registered WP-Cron events, and trigger them with a click. It can also force WordPress to check for ore, plugin or theme updates, log any HTTP requests WordPress makes to external servers and determine which filesystem access method WordPress is using.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2013/01/16/wordpress-core-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automattic Releases Jetpack 2.0, Featuring the New Photon CDN</title>
		<link>https://www.webmaster-source.com/2012/11/21/automattic-releases-jetpack-2-0-featuring-the-new-photon-cdn/</link>
		<comments>https://www.webmaster-source.com/2012/11/21/automattic-releases-jetpack-2-0-featuring-the-new-photon-cdn/#comments</comments>
		<pubDate>Wed, 21 Nov 2012 11:19:28 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Automattic]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4913</guid>
		<description><![CDATA[Automattic&#8217;s Jetpack plugin has certainly grown since I first looked at it. I originally dismissed it, not wanting to unnecessarily tie my own self-hosted blogs to WordPress.com for a few niceties like in-Dashboard traffic stats and very thorough spelling and grammar checking via After the Deadline. I decided to try it out again now that [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-4914" title="WordPress.com Jetpack" src="//www.webmaster-source.com/wp-content/uploads/2012/11/wordpressjetpack.png" alt="" width="275" height="178" />Automattic&#8217;s <a href="http://jetpack.me/">Jetpack</a> plugin has certainly grown since I first looked at it. I originally dismissed it, not wanting to unnecessarily tie my own self-hosted blogs to WordPress.com for a few niceties like in-Dashboard traffic stats and very thorough spelling and grammar checking via After the Deadline.</p>
<p>I decided to try it out again now that it hit the big two-point-oh, and was surprised now only by the amount of functionality it offers, but by how many other plugins it can conceivably replace. The Publicize module, for instance, will automatically post links to new posts on Twitter, Facebook and other popular social networks, so you don&#8217;t need another plugin for that if you run Jetpack. I also found the Mobile Push Notifications and JSON API modules to be intriguing. The former sends push notifications to your iPhone/iPad when new comments are posted, and lets you jump right over to the WordPress iOS app to manage them, and the latter is primarily of interest to developers looking to integrate a WordPress blog into another web site or application. (Previously I used <a href="http://wordpress.org/extend/plugins/json-api/">this plugin</a>, but Jetpack looks roughly equivalent.)</p>
<p>The big new feature in this version is a free service called <a href="http://jetpack.me/support/photon/">Photon</a>, an &#8220;image acceleration and editing service&#8221; which acts as a CDN for your images. It mirrors images it finds in your posts (or ones a theme or plugin developer specifies via an API) on WordPress.com&#8217;s servers, which enables them to be served faster and takes load off your server. This would be excellent for blogs hosted on cheap shared hosting, especially if coupled with a static caching plugin like WP Super Cache or W3 Total Cache.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2012/11/21/automattic-releases-jetpack-2-0-featuring-the-new-photon-cdn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily Embed Whole Tweets in Your Blog Posts With Tweetable 1.2.4</title>
		<link>https://www.webmaster-source.com/2011/12/21/easily-embed-whole-tweets-in-your-blog-posts-with-tweetable-1-2-4/</link>
		<comments>https://www.webmaster-source.com/2011/12/21/easily-embed-whole-tweets-in-your-blog-posts-with-tweetable-1-2-4/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 11:25:19 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4457</guid>
		<description><![CDATA[Have you ever wanted to embed an entire tweet into a WordPress post for some reason? Maybe you were doing a short write-up about a recent news story, and wanted to quote someone&#8217;s amusing tweet on the matter. You could just use a simple blockquote, and link to the tweet, but wouldn&#8217;t you rather embed [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Have you ever wanted to embed an entire tweet into a WordPress post for some reason? Maybe you were doing a short write-up about a recent news story, and wanted to quote someone&#8217;s amusing tweet on the matter. You could just use a simple blockquote, and link to the tweet, but wouldn&#8217;t you rather embed the whole thing, complete with information about the user and interactive buttons?</p>
<blockquote class="twitter-tweet" width="500"><p>The Star Wars wiki (starwars.wikia.com) is every bit as bad as TV Tropes. Send help!</p>
<p>&mdash; Matt Harzewski (@redwall_hp) <a href="https://twitter.com/redwall_hp/status/148639366489706497" data-datetime="2011-12-19T05:42:41+00:00">December 19, 2011</a></p></blockquote>
<p><script src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>The latest version of my <a href="http://wordpress.org/extend/plugins/tweetable/">Tweetable</a> plugin, version 1.2.4, includes support for Twitter&#8217;s new embedding API, which enables you to do that with minimal effort. If you have the plugin installed (and &#8220;Auto-embeds&#8221; is turned on in the Media page of your Settings), you can just paste a properly-formatted URL from Twitter onto a new line in your post. After you hit Publish, it will appear in your post, thanks to the magic of oEmbed.</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4459" title="Embedding tweets with oEmbed" src="//www.webmaster-source.com/wp-content/uploads/2011/12/tweetable-oembed-tweets.png" alt="" width="600" height="459" /></p>
<p>The best part? This is going to be built-in to WordPress 3.4, so you have ensured forward-compatibility. Otto, one of the major contributors to the WordPress core, has already worked up a patch and it is currently slated to be included in version 3.4. Beat me to it. <img src="https://www.webmaster-source.com/wp-includes/images/smilies/icon_razz.gif" alt=":P" class="wp-smiley" /></p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2011/12/21/easily-embed-whole-tweets-in-your-blog-posts-with-tweetable-1-2-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress BlackBox Debug Bar Plugin</title>
		<link>https://www.webmaster-source.com/2011/04/20/wordpress-blackbox-debug-bar-plugin/</link>
		<comments>https://www.webmaster-source.com/2011/04/20/wordpress-blackbox-debug-bar-plugin/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 11:37:21 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3959</guid>
		<description><![CDATA[BlackBox is a handy WordPress plugin that I&#8217;m going to have to try out for development. It adds a debug bar along the top of each page, with items that would be invaluable for plugin and theme developers but probably of little interest to bloggers who don&#8217;t like getting under the hood. With the theme [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://ditio.net/2011/01/29/wordpress-debug-bar-plugin-blackbox/">BlackBox</a> is a handy WordPress plugin that I&#8217;m going to have to try out for development. It adds a debug bar along the top of each page, with items that would be invaluable for plugin and theme developers but probably of little interest to bloggers who don&#8217;t like getting under the hood.</p>
<p>With the theme you can have a look at all of the globals, see any errors generated, and keep tabs on the MySQL queries (including their execution times) behind the page generation. It even includes a profiler.</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-3960 imgborder" title="BlackBox WordPress Debug Bar" src="//www.webmaster-source.com/wp-content/uploads/blackbox-wordpress-debug-bar.png" alt="" width="540" height="83" /></p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2011/04/20/wordpress-blackbox-debug-bar-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StatDash: Statistics on Your WordPress Dashboard</title>
		<link>https://www.webmaster-source.com/2011/04/18/statdash-statistics-on-your-wordpress-dashboard/</link>
		<comments>https://www.webmaster-source.com/2011/04/18/statdash-statistics-on-your-wordpress-dashboard/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 11:42:19 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Code Canyon]]></category>
		<category><![CDATA[Envato]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4020</guid>
		<description><![CDATA[Wouldn&#8217;t it be neat to have an at-a-glance display of common statistical information on your WordPress Dashboard? The StatDash plugin does exactly that, adding a customizable widget that shows stats from Google Analytics, Feedburner, Twitter and even your earnings from the Envato Marketplaces. You can choose which of the services are displayed, as well as [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://codecanyon.net/item/statdash-statistics-on-your-wordpress-dashboard/231639"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-4021" title="StatDash Widget" src="//www.webmaster-source.com/wp-content/uploads/statdash-widget.png" alt="" width="300" height="242" /></a>Wouldn&#8217;t it be neat to have an at-a-glance display of common statistical information on your WordPress Dashboard? The <a href="http://codecanyon.net/item/statdash-statistics-on-your-wordpress-dashboard/231639">StatDash plugin</a> does exactly that, adding a customizable widget that shows stats from Google Analytics, Feedburner, Twitter and even your earnings from the Envato Marketplaces.</p>
<p>You can choose which of the services are displayed, as well as hide the chart if you wish to have the widget be a bit more compact.</p>
<p><a href="http://codecanyon.net/item/statdash-statistics-on-your-wordpress-dashboard/231639">StatDash</a> is my first item to be released on <a href="http://codecanyon.net/">Code Canyon</a>. It&#8217;s priced at $8, and is GPL compliant of course.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2011/04/18/statdash-statistics-on-your-wordpress-dashboard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Admin Bar Plugin Roundup</title>
		<link>https://www.webmaster-source.com/2011/03/30/wordpress-admin-bar-plugin-roundup/</link>
		<comments>https://www.webmaster-source.com/2011/03/30/wordpress-admin-bar-plugin-roundup/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 11:33:55 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3947</guid>
		<description><![CDATA[WordPress 3.1 added an &#8220;admin bar&#8221; that floats along the top of your blog when you are logged in with an account of sufficient privileges, giving you easy access to frequently-accessed pages in the WordPress admin. It didn&#8217;t take long for plugin developers to start finding ways to extend it. Weblog Tools Collection has a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>WordPress 3.1 added an &#8220;admin bar&#8221; that floats along the top of your blog when you are logged in with an account of sufficient privileges, giving you easy access to frequently-accessed pages in the WordPress admin.</p>
<p>It didn&#8217;t take long for plugin developers to start finding ways to extend it.</p>
<p>Weblog Tools Collection has a small <a href="http://weblogtoolscollection.com/archives/2011/03/03/admin-bar-plugin-roundup/">roundup of admin bar plugins</a>, which add additional functionality to the admin bar. One lets you manage what appears on the bar, and several add entirely new items such as debugging tools.</p>
<p><a href="http://weblogtoolscollection.com/archives/2011/03/03/admin-bar-plugin-roundup/">Admin Bar Plugin Roundup</a> [Weblog Tools Collection]</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2011/03/30/wordpress-admin-bar-plugin-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Idea for Canonical WordPress Plugins</title>
		<link>https://www.webmaster-source.com/2010/03/22/my-idea-for-canonical-wordpress-plugins/</link>
		<comments>https://www.webmaster-source.com/2010/03/22/my-idea-for-canonical-wordpress-plugins/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 11:12:06 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3139</guid>
		<description><![CDATA[There has been no shortage of debate over the plans to include canonical (or &#8220;core&#8221;) plugins in WordPress. While I haven&#8217;t fully decided what my stance on the matter is, I do have an idea for what the concept should become. Core plugins shouldn&#8217;t be about &#8220;let&#8217;s have an official plugin for x.&#8221; They should [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There has been no shortage of debate over the plans to include canonical (or &#8220;core&#8221;) plugins in WordPress. While I haven&#8217;t fully decided what my stance on the matter is, I do have an idea for what the concept <em>should</em> become.</p>
<p>Core plugins shouldn&#8217;t be about &#8220;let&#8217;s have an <em>official</em> plugin for <em>x</em>.&#8221; They should instead be frameworks of additional classes and hooks that can be extended by plugins and themes. Instead of having, say, a canonical plugin to integrate Facebook into WordPress, you could have a &#8220;Microblogging&#8221; core plugin that doesn&#8217;t do much aside from add a bunch of new microblogging-related hooks (along with classes for interacting with the Twitter, Facebook, Tumblr, etc. APIs.). Plugins and themes could then hook into the microblogging core plugin, using it&#8217;s generic methods to update one social network or many simultaneously.</p>
<p>Does that make sense? <img src="https://www.webmaster-source.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/03/22/my-idea-for-canonical-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The GPL Doesn&#8217;t Apply to Premium Themes or Plugins</title>
		<link>https://www.webmaster-source.com/2010/02/26/the-gpl-doesnt-apply-to-premium-themes-or-plugins/</link>
		<comments>https://www.webmaster-source.com/2010/02/26/the-gpl-doesnt-apply-to-premium-themes-or-plugins/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 11:53:37 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Themes]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3066</guid>
		<description><![CDATA[Mike Wasylik of Perpetual Beta has an interesting argument in the legendary GPL debate surrounding premium WordPress themes and plugins. He thinks that themes and plugins shouldn&#8217;t be required to be licensed under the GPL for the simple reason that they&#8217;re not derivative. U.S. copyright law defines a derivative work as one that physically includes [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Mike Wasylik of Perpetual Beta has <a href="http://perpetualbeta.com/release/2009/11/why-the-gpl-does-not-apply-to-premium-wordpress-themes/">an interesting argument in the legendary GPL debate</a> surrounding premium WordPress themes and plugins. He thinks that themes and plugins shouldn&#8217;t be required to be licensed under the GPL for the simple reason that they&#8217;re not derivative. U.S. copyright law defines a derivative work as one that physically includes a portion of the copyrighted work, which plugins and themes do not.</p>
<blockquote><p>&#8230;even a theme or plugin that entirely dependens on WordPress to run at  all, or simply improves WordPress in some way, would not be a derivative  work and the GPL would not apply.  For the vast majority of themes I’ve  seen, the GPL would not apply because the theme is not, in my opinion, a  derivative work.  (In fact, if any one thing “incorporates” another,  it’s most likely WordPress incorporating the theme, by use of the PHP <code>include()</code> call, rather than the other way around.)</p></blockquote>
<p>According to the article, the copy of the GPL included in every download of WordPress even states that a derivative work is &#8220;a work containing the Program or a portion of it, either verbatim or with modifications.&#8221; I&#8217;ve been making a similar argument for awhile now. I have yet to see a theme or plugin that actually incorporates WordPress into the plugin code itself, rather than being <em>included by WordPress</em>. It sounds to me like WordPress, if anyone, is the one doing the deriving&#8230;</p>
<p>Most WordPress themes and plugins are unique code for the most part, with a few hooks or function calls. I must have missed the memo that utilizing a third-party API makes your application a subset of the other software. (That would mean any desktop application would be a derivative of the operating system.)</p>
<p>A <a href="http://perpetualbeta.com/release/2009/12/why-the-gplderivative-work-debate-doesnt-matter-for-wordpress-themes/">follow-up article</a> from the same author makes the additional case that, whether the GPL applies or not, the Fair Use Doctrine can protect developers from the licensing terms of the original creator. The same laws that ensure you can quote part of an article without having to pay whatever licensing fee the publisher can cook up apply to software. As little, if any, WordPress code is used in a theme, it would likely be considered fair use.</p>
<p>I like some of the ideology behind the GPL, and quite a few software packages licensed under it. However, it seems that in this case one party is misusing (or misinterpreting) it to prevent small developers from earning a living while further enriching the WordPress community. For what reason, good intentioned or no, I cannot guess.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/02/26/the-gpl-doesnt-apply-to-premium-themes-or-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the WordPress Uploader in Your Plugin or Theme</title>
		<link>https://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/</link>
		<comments>https://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 11:20:18 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Themes]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=2905</guid>
		<description><![CDATA[WordPress has a nice media uploader dialog that it uses on the editor pages. Now wouldn&#8217;t it be nice if you could use it to handle image uploads for part of a plugin or theme you&#8217;re writing? Maybe you want to add an easy way to change the logo in a theme? A simple &#8220;Upload [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>WordPress has a nice media uploader dialog that it uses on the editor pages. Now wouldn&#8217;t it be nice if you could use it to handle image uploads for part of a plugin or theme you&#8217;re writing? Maybe you want to add an easy way to change the logo in a theme? A simple &#8220;Upload Image&#8221; button would work quite well for that, wouldn&#8217;t it?</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-2906 imgborder" title="WordPress Uploader Dialog" src="//www.webmaster-source.com/wp-content/uploads/wordpress-uploader-dialog.jpg" alt="" width="415" height="324" /></p>
<p>It&#8217;s fairly simple to implement, providing you already have a bit of experience with the WordPress API.</p>
<p>The first step is to prepare your HTML. Put it wherever the code for your <a href="http://codex.wordpress.org/Adding_Administration_Menus">admin page</a> is. You want to have a text input for the image URL, and a button that will launch the uploader dialog.<span id="more-2905"></span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;tr valign=&quot;top&quot;&gt;
&lt;th scope=&quot;row&quot;&gt;Upload Image&lt;/th&gt;
&lt;td&gt;&lt;label for=&quot;upload_image&quot;&gt;
&lt;input id=&quot;upload_image&quot; type=&quot;text&quot; size=&quot;36&quot; name=&quot;upload_image&quot; value=&quot;&quot; /&gt;
&lt;input id=&quot;upload_image_button&quot; type=&quot;button&quot; value=&quot;Upload Image&quot; /&gt;
&lt;br /&gt;Enter an URL or upload an image for the banner.
&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Now that the easy part is out of the way, it&#8217;s time to start making it <em>do</em> something. You need to enqueue some scripts and styles. Here&#8217;s an example function to show how it&#8217;s done:</p>
<pre class="brush: php; title: ; notranslate">
function my_admin_scripts() {
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_register_script('my-upload', WP_PLUGIN_URL.'/my-script.js', array('jquery','media-upload','thickbox'));
wp_enqueue_script('my-upload');
}

function my_admin_styles() {
wp_enqueue_style('thickbox');
}

if (isset($_GET['page']) &amp;&amp; $_GET['page'] == 'my_plugin_page') {
add_action('admin_print_scripts', 'my_admin_scripts');
add_action('admin_print_styles', 'my_admin_styles');
}
</pre>
<p>We need the <em>media-upload</em> and <em>thickbox</em> scripts for starters, as well as jQuery, which is already included. Then we have to register and enqueue our own JavaScript file, <em>my-script.js</em>, which will handle the media uploader functionality. We also need to load the <em>thickbox</em> stylesheet in the next function.</p>
<p>The <em>if (&#8230;)</em> block ensures that the scripts and styles will only be included if the user is on a specific admin page. If you look at your plugin&#8217;s (or theme&#8217;s) admin page, the URL should have a <em>?page=some_string</em> at the end. Substitute <em>my_plugin_page</em> for that string.</p>
<p>Now for the part the actually invokes the uploader: the JavaScript. This will go in the my-script.js file we included earlier.</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery(document).ready(function() {

jQuery('#upload_image_button').click(function() {
 formfield = jQuery('#upload_image').attr('name');
 tb_show('', 'media-upload.php?type=image&amp;amp;TB_iframe=true');
 return false;
});

window.send_to_editor = function(html) {
 imgurl = jQuery('img',html).attr('src');
 jQuery('#upload_image').val(imgurl);
 tb_remove();
}

});
</pre>
<p>The first <em>click()</em> event listener opens a ThickBox dialog when the &#8220;Upload Image&#8221; button is clicked, and loads the uploader page inside it. It also stores the name of the URL input field in a variable, for later use.</p>
<p>The second function overrides the <em>send_to_editor()</em> function in the <em>media-upload</em> script. This is probably the most important part. When the &#8220;Insert into Post&#8221; button is clicked in the uploader dialog, this function fires. It collects the URL of the image that was uploaded, dumps it into the awaiting form field, and closes the ThickBox dialog.</p>
<p>That&#8217;s it. Providing everything went according to planned, you should have a form field that will either accept an arbitrary image URL, or allow a user to upload one on the spot.</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-2907" title="WordPress Media Uploader Field" src="//www.webmaster-source.com/wp-content/uploads/wordpress-upload-field.jpg" alt="" width="414" height="67" /></p>
<p class="alertbubble"><strong>Update:</strong> If you want to use the fancy new media uploader introduced in WordPress 3.5, be sure to check out <a href="http://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/">the revised and updated post</a> that covers it.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/feed/</wfw:commentRss>
		<slash:comments>277</slash:comments>
		</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/


Served from: www.webmaster-source.com @ 2026-04-19 05:00:45 by W3 Total Cache
-->