<?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>Steve Taylor &#187; WordPress</title>
	<atom:link href="http://sltaylor.co.uk/blog/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://sltaylor.co.uk</link>
	<description>Freelance WordPress developer in London - XHTML, CSS &#38; design</description>
	<lastBuildDate>Sat, 19 Nov 2011 16:08:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Custom Fields plugin update for WP 3.3</title>
		<link>http://sltaylor.co.uk/blog/custom-fields-plugin-update-for-wp-3-3/</link>
		<comments>http://sltaylor.co.uk/blog/custom-fields-plugin-update-for-wp-3-3/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 14:25:49 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=869</guid>
		<description><![CDATA[I&#8217;ve just released version 0.7.1 of Developer&#8217;s Custom Fields. It should be showing up on the repository and in your WP admin very soon. It fixes a couple of bugs, one to do with the version number storage, and a more important one for anyone using Gmaps. Because of the attempt to exclude the Gmaps [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released version 0.7.1 of Developer&#8217;s Custom Fields. It should be showing up on the repository and in your WP admin very soon.</p>
<p>It fixes a couple of bugs, one to do with the version number storage, and a more important one for anyone using Gmaps. Because of the attempt to exclude the Gmaps functionality when it&#8217;s been turned off with <code>SLT_CF_USE_GMAPS</code>, the <code>[slt-cf-gmap]</code> shortcode wasn&#8217;t working. This should be fixed now.</p>
<p>Also, I&#8217;ve made the WYSIWYG field type play well with the nice new WP 3.3 <code>wp_editor</code> function. When you upgrade to 3.3 you&#8217;ll also be able to pass values to the <code>$settings</code> parameter of this function with the <code>wysiwyg_settings</code> field parameter. Follow the source to the <code>editor</code> method of the <code>WP_Editor</code> class for details of what settings you can pass through. Thanks to katoen on the wordpress.org forums for the heads up!</p>
<p>There are <a href="https://github.com/gyrus/WordPress-Developers-Custom-Fields/issues">some other things</a> I&#8217;m hoping to address very soon. I just had to release this asap because of the Gmaps shortcode fix and the compatibility with 3.3.</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/custom-fields-plugin-update-for-wp-3-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developer&#8217;s Custom Fields 0.7 released</title>
		<link>http://sltaylor.co.uk/blog/developers-custom-fields-0-7-released/</link>
		<comments>http://sltaylor.co.uk/blog/developers-custom-fields-0-7-released/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 20:48:27 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=855</guid>
		<description><![CDATA[I&#8217;ve just released 0.7 of my Developer&#8217;s Custom Fields plugin, which is now available for download from wordpress.org or automatically via your WordPress plugins page. There&#8217;s quite a few fixes and changes in this version. I&#8217;ll try and detail the most significant changes here in this post. Cleaning up 0.6.1 switched from using &#8220;yes&#8221; for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released 0.7 of my Developer&#8217;s Custom Fields plugin, which is now available for download from <a href="http://wordpress.org/extend/plugins/developers-custom-fields/">wordpress.org</a> or automatically via your WordPress plugins page.</p>
<p>There&#8217;s quite a few fixes and changes in this version. I&#8217;ll try and detail the most significant changes here in this post.</p>
<p><span id="more-855"></span></p>
<h2>Cleaning up</h2>
<p>0.6.1 switched from using &#8220;yes&#8221; for checked single checkboxes (and an empty value for unchecked) to storing either &#8220;1&#8243; or &#8220;0&#8243;. This is because the string &#8220;0&#8243; evaluates to false, but &#8220;no&#8221; evaluates to true! However, the switch may have caused some issues if anyone has code like this:</p>
<pre name="code" class="php">if ( slt_cf_field_value( 'checkbox-field' ) == 'yes' )
      [do some stuff]</pre>
<p>I did! There&#8217;s not much I can do automatically to fix this, so I&#8217;ve included an alert at the top of admin screens that directs people to a new page for tools for this plugin under <i>Tools > Custom Fields data</i>. There&#8217;s a cleanup tool here that:</p>
<ol>
<li>Converts any old &#8220;yes&#8221; / empty checkbox values to &#8220;1&#8243; and &#8220;0&#8243;</li>
<li>Deletes any empty values for fields defined through the plugin (0.7 now only creates meta table entries for fields with a value to store)</li>
<li>Deletes any meta table entries for fields that have the prefix used by the plugin, but which are no longer defined</li>
</ol>
<p>Needless to say, I&#8217;ve included plenty of warning to back up data before doing this. But once the tool has been run, enough attention should have been drawn to the potential issue with checkbox code (above), and the alert disappears.</p>
<h2>The Google map geocoder and jQuery autocomplete</h2>
<p>There had been an issue in that the handy address-finding geocoder field that is include with <code>gmap</code> fields used jQuery UI&#8217;s <code>autocomplete</code>. Turns out that this had been dropped from the version of jQuery UI in the WP core since 3.0&#8212;only I didn&#8217;t notice because I habitually use the Use Google Libraries plugin, and Google&#8217;s jQuery UI does include <code>autocomplete</code>.</p>
<p>WP 3.0 switched to <code>suggest</code>, and converting to this didn&#8217;t look like a simple case of switching functions. In the end, it turns out that <a href="http://wpdevel.wordpress.com/2011/09/23/javascript-changes-in-3-3/">WP 3.3 will ship with &#8220;jQuery 1.6.4 and jQuery UI 1.8.16. [...] the full UI including widgets and effects.&#8221;</a> So <code>autocomplete</code> will soon be there for everyone again. Until then, Developer&#8217;s Custom Fields includes the geocoder field via JS, on the condition that <code>autocomplete</code> is present.</p>
<h2>Scope defaults to all</h2>
<p>The <code>scope</code> parameter now, instead of being required, defaults to an empty array, which will apply the field to all items within the box&#8217;s scope.</p>
<h2>Globally disable functionality</h2>
<p>Some people have requested the ability to globally disable features like the <code>gmap</code> and <code>file</code> field types, which come with a load of JS and other stuff. Now you can do with using constants in wp-config.php, e.g.:</p>
<pre name="code" class="php">define( 'SLT_CF_USE_GMAPS', false );
define( 'SLT_CF_USE_FILE_SELECT', false );</pre>
<p>Both values default to true.</p>
<h2>Documentation and issue tracking</h2>
<p>I was going to shift most stuff for this plugin to GitHub with this version, but that&#8217;ll have to wait until I get more time to work out git for myself. For now, full documentation is now <a href="http://sltaylor.co.uk/wordpress/plugins/slt-custom-fields/docs/">here on this site</a>.</p>
<p>If you find a bug in the plugin, please raise an issue via <a href="https://github.com/gyrus/WordPress-Developers-Custom-Fields/issues">GitHub</a>. And if you&#8217;re not sure your problem is a genuine issue with the plugin or not, just start a <a href="http://wordpress.org/tags/developers-custom-fields?forum_id=10">WP forum thread</a>.</p>
<h2>Other highlights</h2>
<p>Other important changes include:</p>
<ul>
<li>Added <code>terms</code> as an <code>options_type</code> for populating multiple value fields with taxonomy terms</li>
<li>Added a <code>notice</code> field type for text-only notices to the user</li>
<li>Added an <code>above-content</code> settings for the box <code>context</code> parameter, to place boxes on post edit screens above the content editor</li>
<li>Added <code>except_posts</code> and <code>except_users</code> options to the <code>scope</code> field parameter, to exclude certain posts or users that would otherwise be included</li>
<li>Added <code>$file_attach_to_post</code> parameter for <code>file</code> field types, so you can choose whether a file uploaded on a post edit screen is attached to that post or not</li>
<li>Minified JS and CSS (full versions loaded when <a href="http://codex.wordpress.org/Editing_wp-config.php#Debug"><code>SCRIPT_DEBUG</code></a> is true)</li>
</ul>
<p>You can see the full list of changes in the <a href="http://wordpress.org/extend/plugins/developers-custom-fields/changelog/">changelog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/developers-custom-fields-0-7-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manipulating URLs in PHP and WordPress</title>
		<link>http://sltaylor.co.uk/blog/manipulating-urls-in-php-and-wordpress/</link>
		<comments>http://sltaylor.co.uk/blog/manipulating-urls-in-php-and-wordpress/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 13:56:48 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=850</guid>
		<description><![CDATA[A quickie post about a few functions that I&#8217;ve only recently discovered, and really wish I&#8217;d discovered sooner! One is a PHP function, two are WordPress core functions. Both help immensely when you&#8217;re dealing with URLs. parse_url parse_url is a PHP function that takes a full URL and returns an array populated with all the [...]]]></description>
			<content:encoded><![CDATA[<p>A quickie post about a few functions that I&#8217;ve only recently discovered, and <em>really</em> wish I&#8217;d discovered sooner! One is a PHP function, two are WordPress core functions. Both help immensely when you&#8217;re dealing with URLs.</p>
<p><span id="more-850"></span></p>
<h2><code>parse_url</code></h2>
<p><a href="http://uk3.php.net/parse_url"><code>parse_url</code></a> is a PHP function that takes a full URL and returns an array populated with all the components, e.g. the host, the path, the query string, etc. For dealing with the query string you might also want to look at <a href="http://uk3.php.net/manual/en/function.parse-str.php"><code>parse_string</code></a>.</p>
<p>There&#8217;s also <a href="http://uk3.php.net/manual/en/function.http-build-query.php"><code>http_build_query</code></a>, which I think the following two WP functions make use of.</p>
<h2><code>add_query_arg</code></h2>
<p><a href="http://codex.wordpress.org/Function_Reference/add_query_arg"><code>add_query_arg</code></a> is incredibly useful if you want to add something to a URL&#8217;s query string without affecting the query parameters already in place. It defaults to the current URL, and you can either just add a key / value pair, or give it an array of key / value pairs to add.</p>
<h2><code>remove_query_arg</code></h2>
<p><a href="http://codex.wordpress.org/Function_Reference/remove_query_arg"><code>remove_query_arg</code></a> is simply the reverse of <code>add_query_arg</code>.</p>
<p>All together, manipulating URLs becomes a much simpler process with these handy functions!</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/manipulating-urls-in-php-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The WordPress edit_plugins capability</title>
		<link>http://sltaylor.co.uk/blog/wordpress-edit_plugins-capability/</link>
		<comments>http://sltaylor.co.uk/blog/wordpress-edit_plugins-capability/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 14:16:35 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=755</guid>
		<description><![CDATA[I&#8217;ve been finding more and more WordPress plugins that, when they check if the current user should be allowed to view / edit the plugin&#8217;s settings page, check whether the user has the edit_plugins capability. I think this is a bad practice; let me explain why. If you check the Codex on Roles and Capabilities, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been finding more and more WordPress plugins that, when they check if the current user should be allowed to view / edit the plugin&#8217;s settings page, check whether the user has the <code>edit_plugins</code> capability. I think this is a bad practice; let me explain why.</p>
<p><span id="more-755"></span></p>
<p>If you check the Codex on <a href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table">Roles and Capabilities</a>, you&#8217;ll see that there&#8217;s certain capabilities that are, by default, only assigned to admins.</p>
<p>Now, roles can be customized (most easily and reliably, I find, with Justin Tadlock&#8217;s <a href="http://wordpress.org/extend/plugins/members/">Members</a> plugin). That&#8217;s why it&#8217;s advised that, when checking whether a user can do something or not, you check what <em>capabilities</em> they have, not what role they&#8217;re in (usually using <a href="http://codex.wordpress.org/Function_Reference/current_user_can"><code>current_user_can</code></a>).</p>
<p>So, <a href="http://markjaquith.wordpress.com/2006/03/27/how-to-check-if-a-wordpress-user-is-an-administrator/">as detailed by Mark Jaquith</a>, if you want to check whether someone is an admin, you check against a capability that is by and large assigned only to admins&#8212;e.g. <code>manage_options</code>. True, someone might have customized their roles so, for instance, authors have the <code>manage_options</code> capability. But that&#8217;s stupid, and it&#8217;s their problem. As a plugin author, if you limit admin-only stuff to users with <code>manage_options</code>, you&#8217;ve done your job pretty well.</p>
<p>Checking for <code>manage_options</code> is obviously most suited to checks for editing options or settings. For other admin-only bits that are a bit more technical, I often use <code>update_core</code>. I often create a &#8220;Super Editor&#8221; role, which is pretty much like the default Editor role, but with <code>manage_options</code> (so clients can adjust site and plugin settings, but not upgrade or do other more technical things).</p>
<p>Now, as I mentioned, I&#8217;m discovering a number of plugins that use <code>edit_plugins</code> as a check for the plugin settings page. The thing that brought this to my attention as a problem is that I like to include this line in my wp-config.php file:</p>
<p><code>define( 'DISALLOW_FILE_EDIT', true );</code></p>
<p>You can see <a href="http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/capabilities.php#L968">in the core</a> that if this is set, it steps in on capability checks and blocks everyone from editing plugins, themes, or other files. I never use this feature of WordPress&#8212;it can be <em>very</em> risky on production servers, and is largely pointless on dev servers. And I certainly don&#8217;t want my clients using it. So I block it.</p>
<p>Unfortunately, as you&#8217;ll have guessed, this also blocks eveyone from editing the aforementioned plugins&#8217; settings. Not good!</p>
<p>Initially I thought these plugin authors were using <code>edit_plugins</code> as a generic &#8220;admin-only&#8221; check, in the way that I use <code>update_core</code>. I slowly realized that they might be using it under the impression that they&#8217;re being appropriate, i.e. that <code>edit_plugins</code> refers to editing anything to do with plugins, e.g. settings. However, as the core and <a href="http://codex.wordpress.org/Roles_and_Capabilities#edit_plugins">the Codex</a> testify, that&#8217;s not true. This capability refers to editing plugin <em>files</em>.</p>
<p>Unless you&#8217;ve got a good reason to do otherwise, the capability you should use to check if the user should access your plugin settings (usually passed to <a href="http://codex.wordpress.org/Function_Reference/add_options_page"><code>add_options_page</code></a>) is <code>manage_options</code>.</p>
<p>By all means choose something else if it&#8217;s related to the functionality you&#8217;re protecting. If your plugin include some kind of exporting functionality, check against the <code>export</code> capability. But if you do need a more generic &#8220;admin-only&#8221; capability to check against, use something unlikely to be disabled, such as <code>update_core</code>. The very handy <code>DISALLOW_FILE_EDIT</code> constant means that <code>edit_files</code>, <code>edit_themes</code> and <code>edit_plugins</code> are all a bad choice for checking if you&#8217;re dealing with an admin.</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/wordpress-edit_plugins-capability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress core 101</title>
		<link>http://sltaylor.co.uk/blog/wordpress-core-101/</link>
		<comments>http://sltaylor.co.uk/blog/wordpress-core-101/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 12:19:19 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=711</guid>
		<description><![CDATA[Last night&#8217;s London WordPress meetup was good. Hosted by a company called Headshift, we got a quick-fire run through beginner, intermediate and advanced-level topics. Emily Weber gave an overview of how, as a non-techie, she got the social networking site yeah! Hackney going using BuddyPress. Keith Devon heroically compressed WordPress theme development into 20 minutes. [...]]]></description>
			<content:encoded><![CDATA[<p>Last night&#8217;s <a href="http://www.meetup.com/London-WordPress/">London WordPress meetup</a> was good. Hosted by a company called Headshift, we got a quick-fire run through beginner, intermediate and advanced-level topics. Emily Weber gave an overview of how, as a non-techie, she got the social networking site <a href="http://www.yeahhackney.com/">yeah! Hackney</a> going using <a href="http://buddypress.org/">BuddyPress</a>. Keith Devon heroically compressed WordPress theme development into 20 minutes. And Chris Adams gave an equally succinct tour of the WP core. This is an important topic for budding WP developers, I think. Do check out Chris&#8217; slideshow for some good pointers about where to look to start to understand the important aspects of the process that the core goes through when processing a request:</p>
<div style="width:550px;margin-bottom:1em;" id="__ss_8722212"><iframe src="http://www.slideshare.net/slideshow/embed_code/8722212" width="550" height="460" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></div>
<p>And come along to the next meeting!</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/wordpress-core-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add wmode parameter to WordPress oEmbeds</title>
		<link>http://sltaylor.co.uk/blog/add-wmode-parameter-wordpress-oembed/</link>
		<comments>http://sltaylor.co.uk/blog/add-wmode-parameter-wordpress-oembed/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 10:36:19 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=704</guid>
		<description><![CDATA[OK, so we know how to solve the Flash and z-index problem, right? But how to make WordPress add the solution&#8212;the wmode parameter&#8212;to its auto-embedded videos? This should help: add_filter( 'oembed_result', 'slt_wmode_opaque', 10, 3 ); function slt_wmode_opaque( $html, $url, $args ) { if ( strpos( $html, '&#60;param name="movie"' ) !== false ) $html = preg_replace( [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so we know how to solve the <a href="http://slightlymore.co.uk/flash-and-the-z-index-problem-solved/">Flash and <code>z-index</code> problem</a>, right? But how to make WordPress add the solution&#8212;the <code>wmode</code> parameter&#8212;to its auto-embedded videos?</p>
<p>This should help:</p>
<pre name="code" class="php">add_filter( 'oembed_result', 'slt_wmode_opaque', 10, 3 );
function slt_wmode_opaque( $html, $url, $args ) {
	if ( strpos( $html, '&lt;param name="movie"' ) !== false )
		$html = preg_replace( '|&lt;/param&gt;|', '&lt;/param&gt;&lt;param name="wmode" value="opaque"&gt;&lt;/param&gt;', $html, 1 );
	if ( strpos( $html, '&lt;embed' ) !== false )
		$html = str_replace( '&lt;embed', '&lt;embed wmode="opaque"', $html );
	return $html;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/add-wmode-parameter-wordpress-oembed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get post ID from custom post type URLs as well</title>
		<link>http://sltaylor.co.uk/blog/get-post-id-from-custom-post-types-urls/</link>
		<comments>http://sltaylor.co.uk/blog/get-post-id-from-custom-post-types-urls/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 22:47:06 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=701</guid>
		<description><![CDATA[url_to_postid is a great core WordPress function. Give it a URL (from your own site!) and it&#8217;ll return the ID of the post or page it refers to. I&#8217;m using it so clients can paste a URL into a custom field (easy for them), then I can get other stuff related to the content using [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codex.wordpress.org/Function_Reference/url_to_postid"><code>url_to_postid</code></a> is a great core WordPress function. Give it a URL (from your own site!) and it&#8217;ll return the ID of the post or page it refers to. I&#8217;m using it so clients can paste a URL into a custom field (easy for them), then I can get other stuff related to the content using the ID (easy for me).</p>
<p>But it doesn&#8217;t seem to handle custom post type URLs. So I wrote a little workaround&#8230;</p>
<p><span id="more-701"></span></p>
<pre name="code" class="php">function slt_url_to_postid( $url ) {
	// Try the core function
	$post_id = url_to_postid( $url );
	if ( $post_id == 0 ) {
		// Try custom post types
		$cpts = get_post_types( array(
			'public'   =&gt; true,
			'_builtin' =&gt; false
		), 'objects', 'and' );
		// Get path from URL
		$url_parts = explode( '/', trim( $url, '/' ) );
		$url_parts = array_splice( $url_parts, 3 );
		$path = implode( '/', $url_parts );
		// Test against each CPT's rewrite slug
		foreach ( $cpts as $cpt_name =&gt; $cpt ) {
			$cpt_slug = $cpt-&gt;rewrite['slug'];
			if ( strlen( $path ) &gt; strlen( $cpt_slug ) &amp;&amp; substr( $path, 0, strlen( $cpt_slug ) ) == $cpt_slug ) {
				$slug = substr( $path, strlen( $cpt_slug ) );
				$query = new WP_Query( array(
					'post_type'			=&gt; $cpt_name,
					'name'				=&gt; $slug,
					'posts_per_page'	=&gt; 1
				));
				if ( is_object( $query-&gt;post ) )
					$post_id = $query-&gt;post-&gt;ID;
			}
		}
	}
	return $post_id;
}</pre>
<p>I&#8217;ve had to alter it a little from the code I&#8217;m using. My code works, but if I&#8217;ve goofed in getting it ready for public consumption, please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/get-post-id-from-custom-post-types-urls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Force display of description field in WordPress menus</title>
		<link>http://sltaylor.co.uk/blog/force-display-of-description-field-in-wordpress-menus/</link>
		<comments>http://sltaylor.co.uk/blog/force-display-of-description-field-in-wordpress-menus/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 20:49:25 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=698</guid>
		<description><![CDATA[A very small but very good discovery I made at this year&#8217;s WordCamp Portsmouth was thanks to Robert O&#8217;Rourke. I never knew that if you folded down the Screen Options at the top of the Appearance > Menus admin screen in WordPress, you get a few extra fields for menu items. They&#8217;re hidden by default. [...]]]></description>
			<content:encoded><![CDATA[<p>A very small but very good discovery I made at this year&#8217;s WordCamp Portsmouth was thanks to Robert O&#8217;Rourke. I never knew that if you folded down the <b>Screen Options</b> at the top of the <i>Appearance > Menus</i> admin screen in WordPress, you get a few extra fields for menu items. They&#8217;re hidden by default.</p>
<p>The big one for me is &#8220;Description&#8221;. I&#8217;ve often used a menu for managing the items (i.e. posts and pages) that are featured in a carousel on the home page of a site. I wrote my own code to populate the menu query with information from the posts the menu items refer to&#8212;specifically, a description or extract to use as teaser text. Well, this little discovery that I can allow clients to set (or override) the teaser text right there while they&#8217;re managing the carousel &#8220;menu&#8221; is small; but I think little things like this really help clients when they&#8217;re busy managing their site.</p>
<p>But if you have to explain to them to open <b>Screen Options</b> and check a box to do something that might be important, it&#8217;s two steps forward and one step back. A bit better, but not ideal.</p>
<p>What if you could force &#8220;Description&#8221; to be checked?</p>
<p><span id="more-698"></span></p>
<p>Here&#8217;s how:</p>
<pre name="code" class="php">add_filter( 'get_user_option_managenav-menuscolumnshidden', 'slt_nav_menus_columns_hidden' );
function slt_nav_menus_columns_hidden( $result ) {
	if ( in_array( 'description', $result ) )
		unset( $result[ array_search( 'description', $result ) ] );
	return $result;
}</pre>
<p>These <b>Screen Options</b> are stored in user preferences, so you need to filter a specific user option. Look <a href="http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/user.php#L274">here</a> to see where this filter is being applied in the core. You&#8217;ll see the option that&#8217;s passed <a href="http://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/includes/template.php#L257">here</a>. The <code>$screen->id</code> is basically the admin file being viewed, with <code>.php</code> stripped off. These pointers should get you going working out how this all works to adapt the above code.</p>
<p>The callback hooked onto the filter just checks to see if <code>description</code> is in the list of hidden fields, and takes it out if it is.</p>
<p>Hey presto, the description field is always on!</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/force-display-of-description-field-in-wordpress-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordCamp Portsmouth UK 2011</title>
		<link>http://sltaylor.co.uk/blog/wordcamp-portsmouth-uk-2011/</link>
		<comments>http://sltaylor.co.uk/blog/wordcamp-portsmouth-uk-2011/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 11:43:24 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=689</guid>
		<description><![CDATA[Just back from this year&#8217;s WordCamp in Portsmouth. Had a great time&#8212;met some interesting people, learned loads of new stuff, and verily soaked up the ongoing good vibes in the WordPress community. I did my first WordCamp talk, &#8216;Beyond the 5-minute Install&#8217;, which was aimed at beginners who wanted to know the non-standard but nigh [...]]]></description>
			<content:encoded><![CDATA[<p>Just back from this year&#8217;s WordCamp in Portsmouth. Had a great time&#8212;met some interesting people, learned loads of new stuff, and verily soaked up the ongoing good vibes in the WordPress community.</p>
<p>I did my first WordCamp talk, &#8216;Beyond the 5-minute Install&#8217;, which was aimed at beginners who wanted to know the non-standard but nigh essential things to do when installing WordPress to make things secure and hunky dory. There were also tips to make things easier for developers. It went down pretty well&#8212;thanks to everyone who bothered to say hi and give me feedback! I&#8217;ve posted the slides <a href="http://www.slideshare.net/Steve-Taylor/beyond-the-wordpress-5-minute-install/">here on SlideShare</a>. There&#8217;s not much text there, and I don&#8217;t think the talk was recorded. I might get round to writing an accompanying tutorial, but don&#8217;t hold your breath! Hopefully it&#8217;ll be of some use for people who weren&#8217;t there, as well as a good reminder for those who were. To grab the code snippets, copy from the SlideShare transcription, but beware of the syntax and any funny characters&#8212;grab the code from there, but check against the slides. <a href="http://sltaylor.co.uk/contact/">Let me know</a> if you&#8217;ve any problems with the code.</p>
<p>There were a bunch of great talks, though the really good stuff was in the panel discussions, the &#8220;site doctor&#8221; session, and down the pub. Rather than do a run-through of the actual talks, I&#8217;m just going to rattle through the highlights of what I learned:</p>
<ul>
<li><strong>Responsive web design.</strong> I really need to get my shit together and learn this stuff properly! I suspect how soon this happens will be dictated by how soon I work on a project that has a significant mobile audience. Let&#8217;s see.</li>
<li><strong>SEO is dead.</strong> Well, of course it&#8217;s not dead. We still need to do the basics. But those basics, which have served people who know them so well so far, are pretty much common knowledge now. The edge is in generating organic conversations about your stuff. My guess is this makes it harder for this stuff to be &#8220;forced&#8221;&#8212;but those giving it a go will be more and more insidious.</li>
<li><strong>LinkedIn.</strong> Apparently this is a hot place for business networking. I&#8217;ve always just had a profile there because I may as well. If I was looking for business contacts, given what people in the know were saying, I would definitely be working my profile more.</li>
<li><strong><a href="http://schema.org/">schema.org</a> is big news.</strong> Google, Microsoft and Yahoo! have put differences aside for this specification for structured data for search engines. Bearing in mind <a href="http://www.readwriteweb.com/archives/is_schemaorg_really_a_google_land_grab.php">some caveats</a>, this is really interesting.</li>
<li><strong>WordPress menus have a description field!</strong> Who knew? <a href="http://interconnectit.com/author/rob/">Robert O&#8217;Rourke</a> did. All you have to do is fold out the Screen Options when you&#8217;re on the menus page, and switch on the description. Great!</li>
</ul>
<p>I guess the large amount of non-WordPress-specific stuff in the above list reflects my growing knowledge of all things WordPress. But I also think it&#8217;s to do with WordPress&#8217;s growing maturity. There&#8217;s <em>always</em> things to discover about it; but the platform is settling down a bit, with much core &#8220;full CMS&#8221; functionality now in place, and people are thinking more about what they are doing with the platform, rather than the platform itself.</p>
<p>But hey, there&#8217;s always space at a WordCamp to find out about some juicy plugins you&#8217;ve not heard of before! Here&#8217;s my discoveries:</p>
<ul>
<li><strong><a href="http://jigoshop.com/">Jigoshop</a>:</strong> &#8220;A WordPress eCommerce plugin that works.&#8221; Not tried it, but it looks interesting.</li>
<li><strong><a href="http://wordpress.org/extend/plugins/eg-attachments/">EG Attachments</a>:</strong> I&#8217;ve got a bit of code that does this&#8212;lists files attached to a post. But this looks good, I might use it.</li>
<li><strong><a href="http://wordpress.org/extend/plugins/front-end-editor/">Front End Editor</a>:</strong> Wow. Crikey. This is interesting. It&#8217;s a front end editor. Lets you edit, WYSIWYG style, on the front end. I&#8217;d be wary of something like this, but it&#8217;s written by some guys who know their WordPress stuff. One to watch.</li>
<li><strong><a href="https://github.com/davidgtonge/Very-Simple-Post-Images">Very Simple Post Images</a></strong>: Only on github for now, this was being developed at WordCamp, and is a very promising improvement to the WordPress images / gallery management interface.</li>
<li><strong><a href="http://wordpress.org/extend/plugins/wp-document-revisions/">WP Document Revisions</a>:</strong> Also still in development, also very promising.
</ul>
<p>Many thanks to all the organisers for pulling of another brilliant weekend, and thanks to Richard Boakes for getting it all sorted in Portsmouth. See you next year!</p>
<p>Coming up, there&#8217;s <a href="http://www.meetup.com/London-WordPress/">more WordPress London Meetups</a> a one day <a href="http://www.wp-brighton.org.uk/">WordPress &#038; business event in Brighton</a> on 23rd September. Hopefully see you there, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/wordcamp-portsmouth-uk-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force Strong Passwords plugin</title>
		<link>http://sltaylor.co.uk/blog/force-strong-passwords-plugin/</link>
		<comments>http://sltaylor.co.uk/blog/force-strong-passwords-plugin/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 18:14:04 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=684</guid>
		<description><![CDATA[I&#8217;ve just released a new little plugin: Force Strong Passwords. The code has been part of my custom themes for a while, and I realized it should be a plugin as I&#8217;ve been preparing my talk for this weekend&#8217;s WordCamp (eek!). Anyway, the basic idea is that it enforces the password strength indicated by the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released a new little plugin: <a href="http://wordpress.org/extend/plugins/force-strong-passwords/">Force Strong Passwords</a>.</p>
<p>The code has been part of my custom themes for a while, and I realized it should be a plugin as I&#8217;ve been preparing my talk for this weekend&#8217;s WordCamp (eek!). Anyway, the basic idea is that it <em>enforces</em> the password strength indicated by the little meter on the WordPress user edit screen. It only forces strong passwords for users who can <em>do</em> stuff, i.e. change the live site in some way.</p>
<p>There&#8217;s all sorts of scope for options, etc., but this has been serving me well for a while. All in good time. For now, it&#8217;s an easy way to combat one of the largest vulnerabilities in client sites: people who use weak passwords.</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/force-strong-passwords-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  sltaylor.co.uk/blog/category/wordpress/feed/ ) in 0.31224 seconds, on Feb 4th, 2012 at 1:55 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 4th, 2012 at 2:55 am UTC -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache Is Fully Functional :-) ... A Quick Cache file was just served for (  sltaylor.co.uk/blog/category/wordpress/feed/ ) in 0.00052 seconds, on Feb 4th, 2012 at 2:25 am UTC. -->
