<?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>Lee Willis &#187; Lee Willis</title>
	<atom:link href="http://www.leewillis.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leewillis.co.uk</link>
	<description></description>
	<lastBuildDate>Sat, 11 May 2013 19:18:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding SKU to email notifications in WP e-Commerce</title>
		<link>http://www.leewillis.co.uk/adding-sku-to-email-wp-e-commerce/</link>
		<comments>http://www.leewillis.co.uk/adding-sku-to-email-wp-e-commerce/#comments</comments>
		<pubDate>Sat, 11 May 2013 19:18:51 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[SKU]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP E-Commerce]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=561</guid>
		<description><![CDATA[Adding the SKU (Or other information) to order emails in WP e-Commerce has been an often-requested feature. Up until recently it meant editing plugin files to apply the changes, and remembering to re-apply them on every update. Thanks to the &#8230; <a href="http://www.leewillis.co.uk/adding-sku-to-email-wp-e-commerce/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Adding the SKU (Or other information) to order emails in WP e-Commerce has been an often-requested feature. Up until recently it meant editing plugin files to apply the changes, and remembering to re-apply them on every update. </p>
<p>Thanks to the great work that&#8217;s been going on in WP e-Commerce core &#8211; there are now a bunch of useful hooks and filters that allow the content to be changed by filters rather than by editing the plugin direct.</p>
<p>So &#8211; if you want to add the SKU to your order emails you can just install and enable the plugin below to add it for you.</p>
<div class="github-embed github-embed-repository">
<p><a href="https://github.com/leewillis77/wpec-sku-notification-emails" target="_blank"><strong>WP e-Commerce SKU in notification emails</strong></a><br/><a href="https://github.com/leewillis77/wpec-sku-notification-emails" target="_blank">https://github.com/leewillis77/wpec-sku-notification-emails</a><br/>0 forks.<br/>0 open issues.<br/>Recent commits:
<ul class="github_commits">
<li class="github_commit"><a href="https://github.com/leewillis77/wpec-sku-notification-emails/commit/f6c466a9899e17e3aa23e32943c4d82e9a78c14f" target="_blank">Add deploy script</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wpec-sku-notification-emails/commit/922c595733b30bf2f31d3126e6186f9e8074aa96" target="_blank">Add readme.txt</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wpec-sku-notification-emails/commit/9d6e8f25a0fd0eade9cfd98978058358569a176a" target="_blank">Spacing tweak</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wpec-sku-notification-emails/commit/a8c738766a300a2124ef085313dbe40ac626f2b7" target="_blank">Fix readme.md</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wpec-sku-notification-emails/commit/a8792f5436c6916fca966c9e71010de16844bec7" target="_blank">Initial ccheckin</a>, Lee Willis</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/adding-sku-to-email-wp-e-commerce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change text in a WordPress plugin</title>
		<link>http://www.leewillis.co.uk/how-to-change-text-in-a-wordpress-plugin/</link>
		<comments>http://www.leewillis.co.uk/how-to-change-text-in-a-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 17:30:00 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[translation]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=543</guid>
		<description><![CDATA[One of the great things about using an out-of-the-box solution like WordPress is that you can get something up and running pretty quickly. That&#8217;s been one of WordPress&#8217; strengths over the years. However, if you&#8217;re building sites for other people &#8230; <a href="http://www.leewillis.co.uk/how-to-change-text-in-a-wordpress-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>One of the great things about using an out-of-the-box solution like WordPress is that you can get something up and running pretty quickly. That&#8217;s been one of WordPress&#8217; strengths over the years. However, if you&#8217;re building sites for other people then sometimes parts of the generic-ness seep through and detract from the overall feel of the solution. Specifically &#8211; terminology that is great in a generic solution isn&#8217;t always helpful in a custom, or specific solution.</p>
<p>None of this is a criticism of WordPress, but as you start building larger, or more complex sites you&#8217;ll probably want to start smoothing off some of these rough edges, and make sure the language of the site (frontend or admin side) makes sense in the specific context of the site you&#8217;re working on.</p>
<p>That&#8217;s something I come across frequently in my day job as a Drupal developer. Fortunately Drupal has the excellent <a href="http://drupal.org/project/stringoverrides" target="_blank">String Overrides</a> module. This lets you specify the current string, and a replacement, and will change the text whenever that string is used, with the caveat that the original string has to be passed through Drupal&#8217;s translation function t().</p>
<p>When someone recently asked me how to change some text in one of my own WordPress plugins &#8211; my first suggestion was this exact same approach. After all, all of my Premium plugins use translatable strings, and suggesting to someone that they should create a translation file just to change one or two strings for their needs has always seemed a bit excessive. So &#8211; I had a hunt around the WordPress.org repo for something similar, but couldn&#8217;t really find anything that did the job.</p>
<p>Figuring it&#8217;d be something fairly simple to achieve I set out to knock up a plugin that did the job. So next time you need to quickly change a string in WordPress, or a plugin you&#8217;re using &#8211; don&#8217;t hack it in the plugin &#8211; or in WordPress core, leaving your client unable to upgrade, give &#8220;Say What?&#8221; a go:</p>
<div id="attachment_548" class="wp-caption alignleft" style="width: 131px"><a href="http://www.leewillis.co.uk/wp-content/uploads/2013/03/screenshot-1.png" rel="lightbox[543]"><img class="size-full wp-image-548" alt="The strings we want to change" src="http://www.leewillis.co.uk/wp-content/uploads/2013/03/screenshot-1.png" width="121" height="81" /></a><p class="wp-caption-text">The strings we want to change</p></div>
<div id="attachment_549" class="wp-caption alignleft" style="width: 786px"><a href="http://www.leewillis.co.uk/wp-content/uploads/2013/03/screenshot-2.png" rel="lightbox[543]"><img class="size-full wp-image-549 " alt="The say what page - setting up our string replacements" src="http://www.leewillis.co.uk/wp-content/uploads/2013/03/screenshot-2.png" width="776" height="280" /></a><p class="wp-caption-text">The say what page &#8211; setting up our string replacements</p></div>
<div id="attachment_550" class="wp-caption alignleft" style="width: 142px"><a href="http://www.leewillis.co.uk/wp-content/uploads/2013/03/screenshot-3.png" rel="lightbox[543]"><img class="size-full wp-image-550 " alt="The text - automatically replaced for us" src="http://www.leewillis.co.uk/wp-content/uploads/2013/03/screenshot-3.png" width="132" height="79" /></a><p class="wp-caption-text">The text &#8211; automatically replaced for us</p></div>
<div style="clear: both;">&nbsp;</div>
<div class="wpdotorg-embed wpdotorg-embed-plugin">
<p><a href="http://wordpress.org/extend/plugins/say-what" target="_blank"><strong>Say what?</strong></a><br/>by <span class="wpdotorg-embed-plugin-author"><a href="http://www.leewillis.co.uk/">Lee Willis</a></span></p>
<p class="wpdotorg-embed-plugin-description">
<p>An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code. Simply enter the current string, and what you want to replace it with and the plugin will automatically do the rest!</p>
<p>The plugin&#8217;s available for forking and contribution over on <a href="https://github.com/leewillis77/say-what">GitHub</a></p>
</p>
<p><strong>Stats:</strong></p>
<ul class="wpdotorg-embed-stats-list">
<li>Current version: 0.9.1</li>
<li>Rating: 100 (2 ratings)</li>
<li>Downloaded 129 times</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/how-to-change-text-in-a-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily embed WordPress.org plugin details into your posts</title>
		<link>http://www.leewillis.co.uk/embed-wordpress-org-plugin-details-into-posts/</link>
		<comments>http://www.leewillis.co.uk/embed-wordpress-org-plugin-details-into-posts/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 22:53:29 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[oEmbed]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=538</guid>
		<description><![CDATA[I&#8217;m slowly working through tidying up information about my free plugins. Part of this meant that I wanted a way to easily include the latest information about my free plugins in the page as a summary. For plugins hosted on &#8230; <a href="http://www.leewillis.co.uk/embed-wordpress-org-plugin-details-into-posts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m slowly working through tidying up information about my free plugins. Part of this meant that I wanted a way to easily include the latest information about my free plugins in the page as a summary. For plugins hosted on GitHub I&#8217;m using my <a href="https://github.com/leewillis77/wp-github-oembed" title="GitHub oEmbed plugin" target="_blank">GitHub oEmbed plugin</a>, but I have quite a few plugins hosted solely over on WordPress.org. </p>
<p>So, I&#8217;ve also now published a plugin that will let you embed plugin summaries from WordPress.org into your posts and pages just by pasting in the URL. </p>
<p>Check it out here:</p>
<div class="github-embed github-embed-repository">
<p><a href="https://github.com/leewillis77/wp-wpdotorg-embed" target="_blank"><strong>A WordPress plugin that allows you to embed realtime information about plugins from WordPress.org into posts and pages simply by pasting in the URL to the plugin into your post.</strong></a><br/><a href="https://github.com/leewillis77/wp-wpdotorg-embed" target="_blank">https://github.com/leewillis77/wp-wpdotorg-embed</a><br/>1 forks.<br/>0 open issues.<br/>Recent commits:
<ul class="github_commits">
<li class="github_commit"><a href="https://github.com/leewillis77/wp-wpdotorg-embed/commit/56857b1f0d4579bb8bdcdee567104f7ed8fa223e" target="_blank">Bump</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-wpdotorg-embed/commit/ff9ba1264df4d8af4e4b739152573619a3856e04" target="_blank">Expire oEmbed cache items</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-wpdotorg-embed/commit/56a046822170bf7431d99fb658cab08e020a12d0" target="_blank">Merge pull request #1 from DrewAPicture/thousandsAdd filterable thousands separator for downloads count.</a>, leewillis77</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-wpdotorg-embed/commit/d0a6ff71eb3800ff152acccc3ac08412d7fa7cdc" target="_blank">Also use number_format_i18n() for oembed_wpdotorg_theme().</a>, DrewAPicture</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-wpdotorg-embed/commit/388a1ab04ff5b886af51241f2011f4875fcb44ea" target="_blank">Use number_format_i18n() to format the download count.</a>, DrewAPicture</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/embed-wordpress-org-plugin-details-into-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple embedding for non oEmbed services</title>
		<link>http://www.leewillis.co.uk/simple-wordpress-embedding-oembed-services/</link>
		<comments>http://www.leewillis.co.uk/simple-wordpress-embedding-oembed-services/#comments</comments>
		<pubDate>Sat, 09 Feb 2013 19:50:20 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[oEmbed]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=507</guid>
		<description><![CDATA[I recently posted about my GitHub embed plugin for WordPress. The plugin performs a neat trick of hooking into WordPress&#8217; oEmbed infrastructure to allow you just to paste in a URL and retrieve an embed for a service that doesn&#8217;t &#8230; <a href="http://www.leewillis.co.uk/simple-wordpress-embedding-oembed-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently posted about my <a href="http://wordpress.org/extend/plugins/github-embed/" target="_blank">GitHub embed plugin</a> for WordPress. The plugin performs a neat trick of hooking into WordPress&#8217; oEmbed infrastructure to allow you just to paste in a URL and retrieve an embed for a service that doesn&#8217;t natively support oEmbed.</p>
<p>This post is just a quick walk through explaining the approach. In general the plugin:</p>
<ul>
<li><span style="line-height: 13px;">Registers an oEmbed handler for the selected URLs (http://github.com/{something} in our example)</span></li>
<li>Registers an internal oEmbed handler for that URL</li>
<li>Handles the oEmbed call itself, retrieving the details it needs via the 3rd party&#8217;s API and then passing WordPress back an oEmbed response</li>
</ul>
<p>Effectively you make your own site an oEmbed provider for the service you want to embed. Here&#8217;s the key bits of code:</p>
<p>First &#8211; we register an oEmbed handler, and point it to an internal URL:</p>
<pre class="php:nogutter:nocontrols" name="code">function register_oembed_handler() {
    $oembed_url = home_url ();
    $key = get_key();
    $oembed_url = add_query_arg ( array ( 'github_oembed' =&gt; $key ), $oembed_url);
    wp_oembed_add_provider ( '#https?://github.com/.*#i', $oembed_url, true );
}
add_action ( 'init', 'register_oembed_handler' );</pre>
<p><em>Note:</em> get_key() just generates a site-specific key to stop other people using your oEmbed service.</p>
<p>Next, we tell WordPress to look out for an inbound oEmbed request:</p>
<pre class="php:nogutter:nocontrols" name="code">
function handle_oembed() {

    if ( ! isset ( $_GET['github_oembed'] ) ) {
        return;
    }
    // Check this request is valid
    if ( $_GET['github_oembed'] != $this->get_key() ) {
        header ( 'HTTP/1.0 403 Forbidden' );
	die ( 'Sad Octocat is sad.' );
    }

    // Check we have the required information
    $url = isset ( $_REQUEST['url'] ) ? $_REQUEST['url'] : null;
    $format = isset ( $_REQUEST['format'] ) ? $_REQUEST['format'] : null;

    // Call the 3rd party service, and create an oEmbed response here

}
add_action ( 'init', 'handle_oembed' );
</pre>
<p>All we need to do now, is retrieve the details we need using whatever API tools are available, then create an oEmbed response, e.g.</p>
<pre class="php:nogutter:nocontrols" name="code">
    $response = new stdClass();
    $response->type = 'rich';
    $response->width = '10';
    $response->height = '10';
    $response->version = '1.0';
    $response->title = $repo->description;
    $response->html = '<strong>Your info here</strong>';
    
    header ( 'Content-Type: application/json' );
    echo json_encode ( $response );
    die();
</pre>
<p>And that&#8217;s it in theory, simple as pie. If you want to see working example, checkout out the github embed plugin on github:</p>
<div class="github-embed github-embed-repository">
<p><a href="https://github.com/leewillis77/wp-github-oembed" target="_blank"><strong>WordPress Github &quot;oEmbed&quot; plugin</strong></a><br/><a href="https://github.com/leewillis77/wp-github-oembed" target="_blank">https://github.com/leewillis77/wp-github-oembed</a><br/>1 forks.<br/>3 open issues.<br/>Recent commits:
<ul class="github_commits">
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/f5afb726d80dd7ec4fab7d42e73e57f5f2d70be0" target="_blank">Whitespace fixes</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/56e2b41323b5371f1044c7d9e73eed4a74d17682" target="_blank">Tagging 1.3</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/6fc8ae05bbf1ff0d7477d36e9b84763226a7b5c4" target="_blank">Expiring the oEmbed cache</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/9c060fa4a1411bb555fec605b85d229d607b26f5" target="_blank">Use number_format_i18n</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/c00c53f7db6d761709dc376ab989c08439377a35" target="_blank">Spacing fixes</a>, Lee Willis</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/simple-wordpress-embedding-oembed-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embed Github repo information in WordPress</title>
		<link>http://www.leewillis.co.uk/embed-github-repository-wordpress-post/</link>
		<comments>http://www.leewillis.co.uk/embed-github-repository-wordpress-post/#comments</comments>
		<pubDate>Sat, 09 Feb 2013 16:02:13 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[oEmbed]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=509</guid>
		<description><![CDATA[WordPress offers an &#8220;oEmbed&#8221; service for a number of external services. If you&#8217;re not familiar with this, then it offers an easy way to embed external content into your posts and pages, without having to mess around finding embed code, &#8230; <a href="http://www.leewillis.co.uk/embed-github-repository-wordpress-post/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>WordPress offers an &#8220;oEmbed&#8221; service for a number of external services. If you&#8217;re not familiar with this, then it offers an easy way to embed external content into your posts and pages, without having to mess around finding embed code, pasting it in, and hoping the important bits don&#8217;t get stripped out.</p>
<p>Instead, WordPress&#8217; oEmbed support allows you to simply paste in the URL to the page from your browser, and WordPress does all of the hard work contacting the provider and agreeing how they can embed it.</p>
<p>I wanted to use this to embed a summary of a GitHub repository, but unfortunately GitHub doesn&#8217;t support oEmbed &#8211; although they do have a fairly simple API that can be used to retrieve information about the repository.</p>
<p>I could have written a shortcode to interrogate the API, but I wondered if I could achieve an oembed style user experience instead. The result is the <a href="http://wordpress.org/extend/plugins/github-embed/">Github Embed plugin</a> which is available from WordPress.org. The plugin allows you simply to paste in the URL to either a GitHub profile, or a repository, and have information embedded into your post automatically.</p>
<p>As you might expect, the plugin is also hosted on GitHub, and is embedded below &#8230;</p>
<div class="github-embed github-embed-repository">
<p><a href="https://github.com/leewillis77/wp-github-oembed" target="_blank"><strong>WordPress Github &quot;oEmbed&quot; plugin</strong></a><br/><a href="https://github.com/leewillis77/wp-github-oembed" target="_blank">https://github.com/leewillis77/wp-github-oembed</a><br/>1 forks.<br/>3 open issues.<br/>Recent commits:
<ul class="github_commits">
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/f5afb726d80dd7ec4fab7d42e73e57f5f2d70be0" target="_blank">Whitespace fixes</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/56e2b41323b5371f1044c7d9e73eed4a74d17682" target="_blank">Tagging 1.3</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/6fc8ae05bbf1ff0d7477d36e9b84763226a7b5c4" target="_blank">Expiring the oEmbed cache</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/9c060fa4a1411bb555fec605b85d229d607b26f5" target="_blank">Use number_format_i18n</a>, Lee Willis</li>
<li class="github_commit"><a href="https://github.com/leewillis77/wp-github-oembed/commit/c00c53f7db6d761709dc376ab989c08439377a35" target="_blank">Spacing fixes</a>, Lee Willis</li>
</ul>
</div>
<p>It needs a bit of UI love, and pretty sure it can show some more useful information, but it&#8217;s usable now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/embed-github-repository-wordpress-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding UK counties to WooCommerce</title>
		<link>http://www.leewillis.co.uk/adding-uk-counties-to-woocommerce/</link>
		<comments>http://www.leewillis.co.uk/adding-uk-counties-to-woocommerce/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 22:25:34 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=502</guid>
		<description><![CDATA[I originally posted this to Github a while ago, but I had another enquiry about it just the other day, so thought it probably worth a quick post. WooCommerce by default ships with the United Kingdom as one entity &#8211; &#8230; <a href="http://www.leewillis.co.uk/adding-uk-counties-to-woocommerce/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I originally posted this to Github a while ago, but I had another enquiry about it just the other day, so thought it probably worth a quick post. WooCommerce by default ships with the United Kingdom as one entity &#8211; there&#8217;s no counties.</p>
<p>If you want to add counties (Particularly useful if you want to set different rates per county using something like my <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-pro-shipping/">WooCommerce Pro Shipping</a> extension) then it&#8217;s actually pretty straightforward. </p>
<p>I&#8217;ve posted a quick <a href="https://github.com/leewillis77/woocommerce-uk-counties">plugin to github that registers the UK counties</a> &#8211; you could adapt this if you needed to split out the individual countries, or define your own regions. </p>
<p>Enjoy <img src='http://www.leewillis.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/adding-uk-counties-to-woocommerce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding body classes based on Drupal role / user ID</title>
		<link>http://www.leewillis.co.uk/body-classes-drupal-role-user-id/</link>
		<comments>http://www.leewillis.co.uk/body-classes-drupal-role-user-id/#comments</comments>
		<pubDate>Sun, 13 Jan 2013 15:28:05 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[hints]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=481</guid>
		<description><![CDATA[I&#8217;m writing this down here quickly because it strikes me that it may well come in handy to others. This little module snippet that will add classes to Drupal&#8217;s html (On the body element) to indicate the current user&#8217;s role, &#8230; <a href="http://www.leewillis.co.uk/body-classes-drupal-role-user-id/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m writing this down here quickly because it strikes me that it may well come in handy to others. This little module snippet that will add classes to Drupal&#8217;s html (On the body element) to indicate the current user&#8217;s role, and user ID.</p>
<p>Before:<br />
<textarea class="html:nogutter:nocontrols" name="code">&lt;body class=&#8221;html not-front logged-in no-sidebars page-dashboard toolbar toolbar-drawer&#8221;&gt;</textarea></p>
<p>After:<br />
<textarea class="html:nogutter:nocontrols" name="code">&lt;body class=&#8221;html not-front logged-in no-sidebars page-dashboard role-id-2 role-authenticated-user role-id-8 role-site-administrator user-uid-10 toolbar toolbar-drawer&#8221;&gt;</textarea></p>
<p>Handy if for example you want to style things differently based on the user&#8217;s role. Just drop it into your module, and replace MODULE with your module name.</p>
<p>The code:</p>
<pre class="php:nogutter" name="code">function MODULE_preprocess_html ( &amp;$variables ) {

  global $user;

  foreach ( $user-&gt;roles as $role_id =&gt; $role ) {
    $variables['classes_array'][] = "role-id-".$role_id;
    $variables['classes_array'][] = "role-".strtolower(drupal_clean_css_identifier($role));
  }

  $variables['classes_array'][] = "user-uid-".$user-&gt;uid;

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/body-classes-drupal-role-user-id/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding a dynamic select list to Contact Form 7</title>
		<link>http://www.leewillis.co.uk/dynamic-select-list-contact-form-7/</link>
		<comments>http://www.leewillis.co.uk/dynamic-select-list-contact-form-7/#comments</comments>
		<pubDate>Sun, 04 Nov 2012 15:58:27 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[contact form 7]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=467</guid>
		<description><![CDATA[Contact Form 7 is a great, plugin that allows you to easily add contact forms to your WordPress site. Today, I wanted to make a small tweak to one of my contact forms so I could capture some better information. &#8230; <a href="http://www.leewillis.co.uk/dynamic-select-list-contact-form-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a> is a great, plugin that allows you to easily add contact forms to your WordPress site. Today, I wanted to make a small tweak to one of my contact forms so I could capture some better information.</p>
<p>Specifically, I often receive blog enquiries from people asking questions like &#8220;Can this plugin do XXX?&#8221; without any context. Since I have around 13 free plugins on <a href="http://profiles.wordpress.org/leewillis77/" target="_blank">WordPress.org</a>, and around 14 sold through my own <a href="http://plugins.leewillis.co.uk/" target="_blank">premium plugin</a> site, and numerous others through other websites &#8211; it&#8217;s not always obvious which plugin people are asking about.</p>
<p>So &#8211; I did the obvious thing, and added a drop-down list and asked people to confirm which plugin they were contacting me about. The challenge was that rather than just hardcoding in the list of options, I wanted it to be dynamic, and generated in realtime.</p>
<p>I can see this being useful in lots of different situations so here&#8217;s my solution:</p>
<pre class="php:nogutter:nocontrols" name="code">function ses_add_plugin_list_to_contact_form ( $tag, $unused ) {

    if ( $tag['name'] != 'plugin-list' )
        return $tag;

    $args = array ( 'post_type' =&gt; 'wpsc-product',
                    'numberposts' =&gt; 50,
                    'orderby' =&gt; 'title',
                    'order' =&gt; 'ASC' );
    $plugins = get_posts($args);

    if ( ! $plugins )
        return $tag;

    foreach ( $plugins as $plugin ) {
        $tag['raw_values'][] = $plugin-&gt;post_title;
        $tag['values'][] = $plugin-&gt;post_title;
        $tag['labels'][] = $plugin-&gt;post_title;
        $tag['pipes']-&gt;pipes[] = array ( 'before' =&gt; $plugin-&gt;post_title, 'after' =&gt; $plugin-&gt;post_title);
    }

    return $tag;
}
add_filter( 'wpcf7_form_tag', 'ses_add_plugin_list_to_contact_form', 10, 2);</pre>
<p>That example picks up a select list called &#8220;plugin-list&#8221;, and adds to the options for every post retrieved by the call to get_posts. Here&#8217;s the setup of the default contact form:</p>
<p><img src="http://www.leewillis.co.uk/wp-content/uploads/2012/11/Contact-Form-7-‹-Plugins-by-Lee-Willis-—-WordPress1.png" alt="" title="Contact Form 7 ‹ Plugins by Lee Willis — WordPress" width="469" height="75" class="aligncenter size-full wp-image-473" /></p>
<p>You can see we&#8217;ve set the field name to &#8220;plugin-list&#8221; &#8211; so that our code above can make the changes to the right field, and we&#8217;ve provided a couple of fixed options &#8211; our dynamic ones will be added on after these. </p>
<p>Hopefully this comes in useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/dynamic-select-list-contact-form-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Social Checkout for WooCommerce</title>
		<link>http://www.leewillis.co.uk/social-checkout-woocommerce/</link>
		<comments>http://www.leewillis.co.uk/social-checkout-woocommerce/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 06:52:56 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Pinterest]]></category>
		<category><![CDATA[social networking]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=450</guid>
		<description><![CDATA[I&#8217;ve just released my latest WooCommerce extension. It&#8217;s a fairly simple &#8211; but beneficial plugin for any store. Simply put, the Social Checkout plugin allows you to encourage your users to share their purchases on their favourite social networks. The &#8230; <a href="http://www.leewillis.co.uk/social-checkout-woocommerce/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.leewillis.co.uk/wp-content/uploads/2012/10/social-checkout-blog.png" rel="lightbox[450]"><img class="alignleft size-full wp-image-451" title="social-checkout-blog" src="http://www.leewillis.co.uk/wp-content/uploads/2012/10/social-checkout-blog.png" alt="" width="351" height="268" /></a>I&#8217;ve just released my latest <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-social-checkout">WooCommerce extension</a>. It&#8217;s a fairly simple &#8211; but beneficial plugin for any store. Simply put, the <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-pro-shipping/">Social Checkout</a> plugin allows you to encourage your users to share their purchases on their favourite social networks.</p>
<p>The plugin lists the products purchased, together with simply sharing links for the social networks you&#8217;ve configured. Everything happens post purchase &#8211; so you&#8217;re not making your purchase process more complicated, or making barriers to checkout.</p>
<p>The plugin already supports <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-social-checkout">Facebook sharing of purchased items</a>, <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-social-checkout">Twitter posting</a>, and <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-social-checkout">pinning to Pinterest</a>.</p>
<p>Check out the screenshots below of the setup options.</p>
<p><a href="http://www.leewillis.co.uk/wp-content/uploads/2012/10/social-checkout-admin.png" rel="lightbox[450]"><img class="alignleft size-thumbnail wp-image-452" title="social-checkout-admin" src="http://www.leewillis.co.uk/wp-content/uploads/2012/10/social-checkout-admin-150x80.png" alt="" width="150" height="80" /></a></p>
<p>The plugin&#8217;s under active development, so any other features you think should go in there, or networks should be added &#8211; let me know in the comments!</p>
<div align="center">
<div class="promobanner">Get <a href="http://plugins.leewillis.co.uk/store/plugins/woocommerce-pro-shipping/">WooCommerce Social Checkout</a> today</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/social-checkout-woocommerce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Including a git repo as an SVN external</title>
		<link>http://www.leewillis.co.uk/including-git-repo-svn-external/</link>
		<comments>http://www.leewillis.co.uk/including-git-repo-svn-external/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 20:03:18 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.leewillis.co.uk/?p=436</guid>
		<description><![CDATA[I have a couple of bits of code that I keep in a local SVN repo1 Some of that codes extend existing projects, and include external projects in subfolders. SVN has a great piece of functionality that allows you to &#8230; <a href="http://www.leewillis.co.uk/including-git-repo-svn-external/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have a couple of bits of code that I keep in a local SVN repo<sup><a href="#footnote1">1</a></sup></p>
<p>Some of that codes extend existing projects, and include external projects in subfolders. SVN has a great piece of functionality that allows you to <a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html" target="_blank">embed other SVN repositories in sub-folders</a> in a project, and have them automatically updated.</p>
<p>Unfortunately &#8211; while I&#8217;m using SVN locally, the code I&#8217;m including is hosted in GIT repositories.</p>
<p>Natch.</p>
<p>Fortunately, the Internet is a wonderful place, and after a woeful tweet, the ever-helpful <a href="http://twitter.com/tarendai" target="_blank">@tarendai</a> came up with the spectacularly useful observation:</p>
<p><a href="http://www.leewillis.co.uk/wp-content/uploads/2012/04/Screenshot-from-2012-04-13-205251.png" rel="lightbox[436]"><img src="http://www.leewillis.co.uk/wp-content/uploads/2012/04/Screenshot-from-2012-04-13-205251.png" alt="" title="Screenshot from 2012-04-13 20:52:51" width="565" height="204" class="alignnone size-full wp-image-439" /></a></p>
<p>Turns out that <a href="https://github.com/blog/626-announcing-svn-support" target="_blank">github implemented SVN access to their repos</a>. So &#8211; you can include github<a href="#footnote2"><sup>2</sup></a> projects into SVN repositories as SVN externals &#8211; hurrah!</p>
<p>To get it set up, it&#8217;s just the same as a standard SVN external, e.g. </p>
<p><code>$ svn propedit svn:externals .</code></p>
<p>and then give the folder you want it put in, and the github SVN url, e.g. to include the Campaign Monitor PHP API:</p>
<p><code>createsend-php  https://github.com/campaignmonitor/createsend-php/</code></p>
<p>#win</p>
<p><small><a id="footnote1">1</a>. Note: I&#8217;ll probably move to git shortly, tempted by the fact I use it at work, and by the awesomeness that is <a href="https://github.com/nvie/gitflow" target="_blank">git-flow</a></small><br />
<small><a id="footnote2" /><small>2</a>. Yes, I know that doesn&#8217;t solve it for the general git case, but seriously &#8211; how cool anyway <img src='http://www.leewillis.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.leewillis.co.uk/including-git-repo-svn-external/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.494 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-06-18 19:28:17 -->

<!-- Compression = gzip -->