<?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>Musings of ErisDS &#187; WordPress</title>
	<atom:link href="http://erisds.co.uk/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://erisds.co.uk</link>
	<description>Web development, Symfony, Wordpress and general geekery</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:02:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Upgrading old WordPress installs &#8211; not as scary as you think!</title>
		<link>http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think</link>
		<comments>http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think#comments</comments>
		<pubDate>Fri, 02 Jul 2010 12:27:38 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1380</guid>
		<description><![CDATA[<img src="http://erisds.co.uk/wp-content/uploads/2010/07/wordpress-logo-notext-rgb-150x150.png" alt="" title="WordPress logo" width="150" height="150" class="alignleft size-thumbnail wp-image-1389" />Earlier this week I received an email requesting some help with a WordPress install that had been hacked. The site was almost 3 years old and was still running WordPress 2.2. It was quite funny getting to see and play with retro WordPress again, but it had to go.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
<li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: WordPress Pods Plugin'>Spotlight: WordPress Pods Plugin</a><small>Have you ever needed to build a website which fit...</small></li>
<li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role' rel='bookmark' title='Permanent Link: Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role'>Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role</a><small>Recently I worked on a Wordpress site where I wanted...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://erisds.co.uk/wp-content/uploads/2010/07/wordpress-logo-notext-rgb-300x300.png" alt="" title="WordPress logo" width="300" height="300" class="alignleft size-medium wp-image-1389" />Earlier this week I received an email requesting some help with a WordPress install that had been hacked. The site was almost 3 years old and was still running WordPress 2.2. It was quite funny getting to see and play with retro WordPress again, but it had to go.</p>
<p>First of all I got rid of the hack. I didn&#8217;t do much research into WP2.2 security holes or spend any time trying to work out how it was done, I ran a text search on the files for the text and links that had been injected into the page and quickly discovered some superfluous functions in the theme footer and some other files. Deleting these got rid of the problem and restored the site to normal.</p>
<p>To be honest, I was nervous about upgrading this blog from WordPress 2.9.2 to 3.0, the software is moving on so quickly now, so the concept of upgrading from 2.2 where there isn&#8217;t even the luxury of an upgrade button filled me with dread. I did a little research into upgrading, and put out a <a href="http://twitter.com/ErisDS/status/17333044663" title="ErisDS on twitter - upgrading WordPress 2.2">feeler tweet</a> to see if anyone had experience useful tips. Someone suggested that I upgrade to 2.8 first then 2.9 and 3.0 but I decided to just go for it to start with.</p>
<h2>Upgrading WordPress</h2>
<p>The <a href="http://codex.wordpress.org/Upgrading_WordPress_Extended#Detailed_Upgrade_Instructions_for_1.5.x.2C_and_versions_2.0_-_2.6.5.2C_to_3.0">WordPress documentation has extensive information on upgrading </a>WordPress.</p>
<p>In short, the steps involve:</p>
<ol>
<li>Backing up all your files and database</li>
<li>Deactivating all plugins</li>
<li>Deleting your WordPress install except for the customised parts (wp-config.php, .htaccess, themes, plugins, uploads, images, and any language files)</li>
<li>Downloading the <a href="http://wordpress.org/download/">latest version of WordPress</a> and unpacking.</li>
<li>Uploading the new WordPress files to your website</li>
<li>Going to wp-admin and following the instructions to run the upgrade script</li>
</ol>
<p>The <a href="http://codex.wordpress.org/Upgrading_WordPress_Extended#Detailed_Upgrade_Instructions_for_1.5.x.2C_and_versions_2.0_-_2.6.5.2C_to_3.0">WordPress upgrade documentation</a> goes into great detail, so I highly recommend you follow it word for word. I was very careful to follow the instructions carefully, and I&#8217;m pleased to report that the upgrade was a complete success. Not a bug, not a snag, not a hitch &#8211; easy peasy!</p>
<h2>My Top Tips</h2>
<p>Some additional things I recommend doing are:</p>
<ul>
<li>Be absolutely sure to deactivate all your plugins before deleting files and starting the upgrade process</li>
<li>Once the upgrade process has run, check your website thoroughly before reactivating or upgrading any plugins</li>
<li>If all is OK, take another backup of the database and files at this point</li>
<li>After backing up, reactivate each plugin one-by-one testing the site thoroughly after each reactivation to ensure no bugs are caused and that the plugin provides the expected functionality.</li>
<li>Take note of any plugins which malfunction, see if there is an available upgrade (don&#8217;t run it yet) and deactivate the plugin until you have tested them all</li>
<li>Backup again! You&#8217;ve now got all the working plugins enabled and the site is almost back to normal&#8230; so backup before upgrading your plugins!</li>
<li>Upgrade each plugin one-by-one (and reactivate if necessary), again testing after each upgrade.</li>
<li>You may have to find new plugins to replace old ones which are no longer maintained, but with luck your site should now be back to normal.</li>
</ul>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
<li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: WordPress Pods Plugin'>Spotlight: WordPress Pods Plugin</a><small>Have you ever needed to build a website which fit...</small></li>
<li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role' rel='bookmark' title='Permanent Link: Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role'>Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role</a><small>Recently I worked on a Wordpress site where I wanted...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role</title>
		<link>http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role</link>
		<comments>http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role#comments</comments>
		<pubDate>Wed, 30 Jun 2010 11:30:56 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=924</guid>
		<description><![CDATA[Recently I worked on a Wordpress site where I wanted to be able to customise the dashboard for different user roles. Wordpress by default has administrators, editors, authors, contributors and subscribers. It's not too much to assume you might not want to show your editors or authors all the details of your blog posts etc and this short snippet will allow you to do just that.



Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: WordPress &#8211; Customise the Excerpt Length and More string'>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</a><small>These functions and hooks let you customise the output of...</small></li>
<li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: WordPress Pods Plugin'>Spotlight: WordPress Pods Plugin</a><small>Have you ever needed to build a website which fit...</small></li>
<li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently I worked on a WordPress site where I wanted to be able to customise the dashboard for different user roles. <a href="http://codex.wordpress.org/Roles_and_Capabilities">WordPress has the default roles</a> of administrators, editors, authors, contributors and subscribers. It&#8217;s not too much to assume you might not want to show your editors or authors all the details of your blog posts etc and placing these short code snippets into your theme&#8217;s<kbd>functions.php</kbd> file will allow you to do just that.</p>
<h2>Clearing up</h2>
<p>Lets get rid of the incoming links widget for authors and editors and then clean up some of the other boxes for everyone:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> tidy_dashboard<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_meta_boxes</span><span style="color: #339933;">,</span> <span style="color: #000088;">$current_user</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// remove incoming links info for authors or editors</span><br />
&nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'author'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$current_user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">roles</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'editor'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$current_user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">roles</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal '</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_incoming_links'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// remove the plugins info and news feeds for everyone</span><br />
&nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_plugins'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_primary'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_secondary'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">//add our function to the dashboard setup hook</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_dashboard_setup'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tidy_dashboard'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Here&#8217;s a full list of how to unset each of the current default dashboard widgets:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//Right Now - Comments, Posts, Pages at a glance</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_right_now'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Recent Comments</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_recent_comments'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Incoming Links</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_incoming_links'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Plugins - Popular, New and Recently updated Wordpress Plugins</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_plugins'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Wordpress Development Blog Feed</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_primary'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Other Wordpress News Feed</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_secondary'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Quick Press Form</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_quick_press'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Recent Drafts List</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard_recent_drafts'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h2>Add your own</h2>
<p>Perhaps rather than the default information, you have other items you&#8217;d like to be on the dashboard for authors or editors etc? I often add a dashboard widget to list private pages. Here&#8217;s how:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// function to display widget</span><br />
<span style="color: #000000; font-weight: bold;">function</span> display_dashboard_widget<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">//define arguments for WP_Query()</span><br />
&nbsp; <span style="color: #000088;">$qargs</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'post_type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'post_status'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'private'</span><br />
&nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// perform the query</span><br />
&nbsp; <span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000088;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$qargs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">// setup the content with a list</span><br />
&nbsp; <span style="color: #000088;">$widget_content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;ul&gt;'</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// execute the WP loop</span><br />
&nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000088;">$widget_content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; rel=&quot;bookmark&quot;&gt;'</span><span style="color: #339933;">.</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000088;">$widget_content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// return the content you want displayed</span><br />
&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$widget_content</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<br />
<span style="color: #666666; font-style: italic;">//function to setup widget</span><br />
<span style="color: #000000; font-weight: bold;">function</span> add_dashboard_widgets<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// create a dashboard widget called &quot;private_page_menu_dashboard_widget&quot; with the title &quot;Private Pages Menu&quot; and call our display function to draw it</span><br />
&nbsp; wp_add_dashboard_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'private_page_menu_dashboard_widget'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Private Pages Menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'display_dashboard_widget'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<br />
<span style="color: #666666; font-style: italic;">// finally we have to hook our function into the dashboard setup using add_action</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_dashboard_setup'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'add_dashboard_widgets'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The only problem with <kbd>wp_add_dashboard_widget</kbd> is that it doesn&#8217;t allow you to define where on the dashboard the widget is placed. Instead it just places the box at the bottom of the left hand side in the <kbd>['normal']['core']</kbd> array.</p>
<p>I want my private page menu to display at the top on the right hand side of the dashboard, so I am going to add a few more lines to <kbd>add_dashboard_widgets()</kbd> to shuffle the boxes around the way I want them. This will be overridden by user settings if the boxes are dragged around, but insures that my authors and editors see the box in an obvious position when they first login.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> add_dashboard_widgets<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// don't forget the global to get all dashboard widgets</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_meta_boxes</span><span style="color: #339933;">;</span><br />
&nbsp;<br />
&nbsp; <span style="color: #666666; font-style: italic;">// create a dashboard widget called &quot;private_page_menu_dashboard_widget&quot; with the title &quot;Private Pages Menu&quot; and call our display function to draw it</span><br />
&nbsp; wp_add_dashboard_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'private_page_menu_dashboard_widget'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Private Pages Menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'display_dashboard_widget'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">// reorder the boxes - first save the left and right columns into variables</span><br />
&nbsp; <span style="color: #000088;">$left_dashboard</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000088;">$right_dashboard</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">// take a copy of the new widget from the left column </span><br />
&nbsp; <span style="color: #000088;">$my_widget</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'private_page_menu_dashboard_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$left_dashboard</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'private_page_menu_dashboard_widget'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// remove the new widget from the left column</span><br />
&nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$left_dashboard</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'private_page_menu_dashboard_widget'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">// use array_merge so that the new widget is pushed on to the beginning of the right column's array &nbsp;</span><br />
&nbsp; <span style="color: #000088;">$right_dashboard</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_merge"><span style="color: #990000;">array_merge</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_widget</span><span style="color: #339933;">,</span> <span style="color: #000088;">$right_dashboard</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">// finally replace the left and right columns with the new reordered versions</span><br />
&nbsp; <span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'normal'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$left_dashboard</span><span style="color: #339933;">;</span>&nbsp; <br />
&nbsp; <span style="color: #000088;">$wp_meta_boxes</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$right_dashboard</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>I hope you find these tricks as useful as I do!</p>
<h3>Resources</h3>
<ul>
<li><a href="http://www.smashingmagazine.com/2009/12/14/advanced-power-tips-for-wordpress-template-developers-reloaded/">Power Tips for WordPress Template Developers: Reloaded</a> &#8211; more cool back end optimisations, hacks and tweaks</li>
<li><a href="http://wordpress.org/extend/plugins/register-plus/">Register Plus WordPress Plugin</a> &#8211; customise your registration, login and admin areas</li>
<li><a href="http://codex.wordpress.org/Dashboard_Widgets_API">Dashboard Widgets API</a> &#8211; more info on adding and removing dashboard widgets</li>
</ul>
<p class="small"><strong>A Note on Snippets:</strong> When customising a CMS such as WordPress it is often the simplest pieces of code which are the hardest to either find or remember. These snippets are placed here for my own reference and will hopefully be useful to others. If you find them useful or have any suggestions, please let me know.</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: WordPress &#8211; Customise the Excerpt Length and More string'>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</a><small>These functions and hooks let you customise the output of...</small></li>
<li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: WordPress Pods Plugin'>Spotlight: WordPress Pods Plugin</a><small>Have you ever needed to build a website which fit...</small></li>
<li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</title>
		<link>http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string</link>
		<comments>http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string#comments</comments>
		<pubDate>Fri, 15 Jan 2010 18:17:39 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=944</guid>
		<description><![CDATA[These functions and hooks let you customise the output of <kbd>the_excerpt()</kbd> template tag. Just copy and paste into the <kbd>functions.php</kbd> file in your theme. This works for both posts and pages.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role' rel='bookmark' title='Permanent Link: Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role'>Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role</a><small>Recently I worked on a Wordpress site where I wanted...</small></li>
<li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-creating-debugging-complex-sql-queries-in-symfony' rel='bookmark' title='Permanent Link: Snippet: Creating &#038; Debugging Complex SQL queries in Symfony'>Snippet: Creating &#038; Debugging Complex SQL queries in Symfony</a><small>When working with large and complex datasets in Symfony, there...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>These functions and hooks let you customise the output of <kbd>the_excerpt()</kbd> template tag. Just copy and paste into the <kbd>functions.php</kbd> file in your theme. This works for both posts and pages.</p>
<p>To change the excerpt length (how many words are output -<ins datetime="2010-06-25T12:38:24+00:00"> the default is 55 words</ins>) , define a function which returns the number you want and then call it with <kbd>add_filter()</kbd> on the &#8216;excerpt_length&#8217; filter as shown below.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> custom_excerpt_length<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_length'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_excerpt_length'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>By default excerpts which are generated by <strong>WordPress</strong> (as opposed to defined via the &#8220;Excerpt&#8221; box) have the string &#8220;[...]&#8221; You might want to turn this into a link to the post or page and/or change the dots to something like &#8220;more&#8221;. The code below does both of these things using <kbd>str_replace()</kbd>.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> custom_excerpt_more<span style="color: #009900;">&#40;</span><span style="color: #000088;">$more</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">return</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[...]'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>ID<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;...read more...&lt;/a&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$more</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_more'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_excerpt_more'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>You can change the second parameter of <kbd>str_replace()</kbd> to whatever you want to be displayed. I included the <kbd>$post</kbd> global so that I could get the permalink and make the string into a link to the post/page.</p>
<p>Please note these will not work if you have any plugin installed which removes the excerpt hooks. One such plugin is the <a href="http://wordpress.org/extend/plugins/event-calendar/">Event Calendar 3 plugin</a>. If you come across any more please let me know in the comments.</p>
<p class="small"><strong>A Note on Snippets:</strong> When customising a CMS such as WordPress it is often the simplest pieces of code which are the hardest to either find or remember. These snippets are placed here for my own reference and will hopefully be useful to others. If you find them useful or have any suggestions, please let me know.</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role' rel='bookmark' title='Permanent Link: Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role'>Snippet: WordPress Admin &#8211; Tidy Dashboard Widgets By Role</a><small>Recently I worked on a Wordpress site where I wanted...</small></li>
<li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-creating-debugging-complex-sql-queries-in-symfony' rel='bookmark' title='Permanent Link: Snippet: Creating &#038; Debugging Complex SQL queries in Symfony'>Snippet: Creating &#038; Debugging Complex SQL queries in Symfony</a><small>When working with large and complex datasets in Symfony, there...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Spotlight: WordPress Pods Plugin</title>
		<link>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin</link>
		<comments>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin#comments</comments>
		<pubDate>Sun, 28 Jun 2009 22:09:02 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[spotlight]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=507</guid>
		<description><![CDATA[<img src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-300x162.jpg" alt="Wordpress Pods CMS Plugin" title="Wordpress Pods CMS Plugin" width="300" height="162" class="align-right size-medium" />Have you ever needed to build a website which fit into the "Posts and Page" paradigm of Wordpress 95%, but also needed one or two bits of extra content? I often need to build sites that have a quote/testimonial or banner image tied to individual pages &#038; displayed in the template separately to <kbd>"the_content()"</kbd>. This is fine in Wordpress as long as it remains a one-to-one relationship as it can easily be achieved with <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> (and check out the <a href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin for handling this), but achieving a one-to-many or many-to-many relationship in Wordpress requires some more dramatic extension.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
<li><a href='http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think' rel='bookmark' title='Permanent Link: Upgrading old WordPress installs &#8211; not as scary as you think!'>Upgrading old WordPress installs &#8211; not as scary as you think!</a><small>Earlier this week I received an email requesting some help...</small></li>
<li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: WordPress &#8211; Customise the Excerpt Length and More string'>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</a><small>These functions and hooks let you customise the output of...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="align-right size-medium" title="WordPress Pods CMS Plugin" src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-300x162.jpg" alt="WordPress Pods CMS Plugin" width="300" height="162" />Have you ever needed to build a website which fit into the &#8220;Posts &amp; Page&#8221; paradigm of WordPress 95%, but also needed one or two bits of extra content? I often need to build sites that have a quote/testimonial or banner image tied to individual pages &amp; displayed in the template separately to <kbd>"the_content()"</kbd>. This is fine in WordPress as long as it remains a one-to-one relationship as it can easily be achieved with <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> (and check out the <a href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin for handling this), but achieving a one-to-many or many-to-many relationship in WordPress requires some more dramatic extension.</p>
<p>To my knowledge there are two plugins for doing this. <a href="http://flutter.freshout.us/">Flutter</a> and <a href="http://pods.uproot.us/">Pods</a>.</p>
<h3>Flutter</h3>
<p>I started out using Flutter as I hadn&#8217;t heard of Pods but found it to be clunky, buggy &amp; unintuitive. When editing a content type (or write panel) created by Flutter it looks as though you are in the Post or Page section depending on where you placed your new content type. This is confusing and unnecessary.</p>
<p>The data types provided with Flutter are quite extensive (it even includes a colour picker). However, Flutter&#8217;s image upload control is buggy and I have experienced Flutter jumping to the wrong page, crashing Firefox and losing data. All-in-all I found it to be hard to use, missing key features and lacking documentation which meant I needed something else.</p>
<h3>Pods</h3>
<p>In essence what Pods does is turn WordPress into Drupal. It allows you to define your own content types with multiple fields for adding data so that you can use WordPress&#8217; admin interface and templating system to manage whatever data you want, be it just additional testimonials, or a full-blown product database. It also allows you to define templates for displaying or listing data types &amp; to write helpers and filters to handle the entry and display of complex data.</p>
<p>Pods&#8217; integration into WordPress is much cleaner, meaning that content editing is much more intuitive than in Flutter. The many options for configuring filters and helpers has lead to a slightly complex admin interface, but one that is still highly usable. Pods also has considerably more documentation than Flutter seems to, although it is still lacking in some areas.</p>
<p>For me, the key bit of functionality which has made me love Pods is the PICK data type. It is essentially a drop-down list control, but instead of requiring you to define the options, it allows you to choose to list out other Pods, or WordPress objects such as Posts, Pages or Users. This means you can build relationships between your content items, and that you create blocks of content for your templates by linking pods to Posts or Pages.</p>
<p>One piece of functionality I needed but isn&#8217;t present is the ability to use a PICK to create a drop-down list of all Posts and Pages to choose one to link to. A PICK data type can currently only list out Pages OR Posts OR Users etc, but not both. It is also not possible to list out Attachments, despite them being stored in the same table as Posts and pages.</p>
<p><a href="http://erisds.co.uk/wp-content/uploads/2009/06/pods-pick.jpg"><img class="align-left" title="Pods PICK interface (modified)" src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-pick.jpg" alt="Pods PICK interface (modified)" width="280" height="311" /></a>As I needed this functionality, I decided to implement it. I have added the ability to PICK from Attachments, Posts &amp; Pages, Posts &amp; Attachments, Pages &amp; Attachments, or Posts, Pages &amp; Attachments. Only two files were modified  (<kbd>manage_pods.php</kbd> to add options to the select, and <kbd>Pods.class.php</kbd> to extend the if/else and SQL statements to choose the right data).</p>
<p>If you would like to use my modified version of the Pods plugin, I have made it available for download. Please first download the <a href="http://wordpress.org/extend/plugins/pods/">full Pods plugin</a> and install it. Then download the <a href="http://erisds.co.uk/wp-content/uploads/2009/06/podsmodified.zip">podsmodified</a> and upload them to the <kbd>wp-content/plugins/pods/core</kbd> folder. I haven&#8217;t done much testing on them but it seems to work OK for me, please let me know if you have any issues &amp; I&#8217;ll endeavour to fix them.</p>
<p>So, with my extension, I have found Pods to be extremely useful in several projects. It is a very powerful and ultimately usable CMS solution. However, there are still a few areas where I feel it could be improved:</p>
<ul>
<li>The power of the PICK data type could be improved as explained above.</li>
<li>I also feel that PICKs could be further improved by allowing users to specify a simple &#8220;enum&#8221;-like data type</li>
<li>The documentation, although at extremely useful, could greatly benefit from more detail &amp; in-depth examples</li>
<li>The clunky image upload interface needs work</li>
<li>The interface is usable, but introduces new elements not present in WordPress (namely famfamfam icon buttons) &#8211; by bringing at least the content-editing interface into line with the rest of WordPress I believe this plugin will really come of age</li>
<li>There is currently no way to link to a Pod from a Post or Page without configuring the relationship from the Pod itself (it would be nice to be able to setup custom fields to select from Pods but not necessary as it can be done the other way around).</li>
<li>There appears to be a bug in the PICK &gt; Categories option</li>
</ul>
<p>In summary, I believe the <a href="http://pods.uproot.us/">Pods plugin</a> to be superior to Flutter and have found it more able to suit my needs. The PICK field type, filters and helpers make for an extremely powerful and expressive CMS and Pods integrates neatly with CMS so as not to confuse editors or clients, which is a key concern. I highly recommend the <a href="http://pods.uproot.us/">Pods plugin</a> and look forward to seeing it mature as it has truly enormous potential.</p>
<p>Download <a href="http://erisds.co.uk/wp-content/uploads/2009/06/podsmodified.zip">Pods Modified</a>!</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: WordPress 2.8'>WordPress 2.8</a><small>Over the weekend I updated my blog to Wordpress 2.8....</small></li>
<li><a href='http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think' rel='bookmark' title='Permanent Link: Upgrading old WordPress installs &#8211; not as scary as you think!'>Upgrading old WordPress installs &#8211; not as scary as you think!</a><small>Earlier this week I received an email requesting some help...</small></li>
<li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: WordPress &#8211; Customise the Excerpt Length and More string'>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</a><small>These functions and hooks let you customise the output of...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8</title>
		<link>http://erisds.co.uk/wordpress/wordpress-2-8</link>
		<comments>http://erisds.co.uk/wordpress/wordpress-2-8#comments</comments>
		<pubDate>Sun, 14 Jun 2009 16:46:31 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=457</guid>
		<description><![CDATA[Over the weekend I updated my blog to <a href="http://wordpress.org/development/2009/06/wordpress-28/">Wordpress 2.8</a>. It's been a <del datetime="2009-06-14T18:06:37+00:00">relatively smooth process</del> <ins datetime="2009-06-14T18:06:37+00:00">complete screw-up (see my comment at the bottom)</ins> although I lost my archive and recent post widgets as I had hacked them to be multiple instance. As they are now multiple instance anyway (hurrah) I was able to remove the extra code and get everything back working properly.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: WordPress Pods Plugin'>Spotlight: WordPress Pods Plugin</a><small>Have you ever needed to build a website which fit...</small></li>
<li><a href='http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think' rel='bookmark' title='Permanent Link: Upgrading old WordPress installs &#8211; not as scary as you think!'>Upgrading old WordPress installs &#8211; not as scary as you think!</a><small>Earlier this week I received an email requesting some help...</small></li>
<li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: WordPress &#8211; Customise the Excerpt Length and More string'>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</a><small>These functions and hooks let you customise the output of...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I updated my blog to <a href="http://wordpress.org/development/2009/06/wordpress-28/">WordPress 2.8</a>. It&#8217;s been a <del datetime="2009-06-14T18:06:37+00:00">relatively smooth process</del> <ins datetime="2009-06-14T18:06:37+00:00">complete screw-up (see my comment at the bottom)</ins> although I lost my archive and recent post widgets as I had hacked them to be multiple instance. As they are now multiple instance anyway (hurrah) I was able to remove the extra code and get everything back working properly.</p>
<p>So far I haven&#8217;t taken too much time to dig around but I am definitely liking the new widgets interface. I have several different sidebars (for the homepage, footer, single page, page, etc) so not having to remember to save it and then switch sidebars to make multiple changes is much, much slicker. I&#8217;m really looking to experimenting with the <a href="http://codex.wordpress.org/WordPress_Widgets_Api">new widgets API</a> as well &#8211; I&#8217;ve got a few ideas for widgets, but if anyone reading this has ideas feel free to shoot them at me :)</p>
<p>On the other hand, I really dislike the new plugins interface. Having them all in one long list without a clear indication of which ones are active or inactive is really confusing, especially when you use a lot of plugins like me! I much preferred the old design with sections, where all active plugins were at the top.</p>
<p>Has anyone else had problems with using the widgets interface in Firefox? At first I thought it was either my connection or my hosting, but it works fine in chrome, itjust freezes in Firefox, along with gmail. It&#8217;s very frustrating as although I love chrome, I really miss my delicious, evernote, firebug, and other plugins!</p>
<p><ins datetime="2009-06-14T17:34:41+00:00">Update: Is it me or is tagging not working in WordPress 2.8? I&#8217;m completely unable to add tags to this post!</ins><br />
<ins datetime="2009-06-14T18:50:32+00:00">Update 2: It wasn&#8217;t me, it was DB Cache. Apparently that plugin causes the tagging issue along with hyperdb another DB caching plugin. Hope it&#8217;s fixed soon, but for now I can disable whilst I edit and then re-enable &#8211; fiddly but workable!</ins></p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: WordPress Pods Plugin'>Spotlight: WordPress Pods Plugin</a><small>Have you ever needed to build a website which fit...</small></li>
<li><a href='http://erisds.co.uk/wordpress/upgrading-old-wordpress-installs-not-as-scary-as-you-think' rel='bookmark' title='Permanent Link: Upgrading old WordPress installs &#8211; not as scary as you think!'>Upgrading old WordPress installs &#8211; not as scary as you think!</a><small>Earlier this week I received an email requesting some help...</small></li>
<li><a href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: WordPress &#8211; Customise the Excerpt Length and More string'>Snippet: WordPress &#8211; Customise the Excerpt Length and More string</a><small>These functions and hooks let you customise the output of...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/wordpress-2-8/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
