<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Musings of ErisDS</title>
	
	<link>http://erisds.co.uk</link>
	<description>Web development, Symfony, Wordpress and general geekery</description>
	<lastBuildDate>Mon, 30 Aug 2010 16:54:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/erisds" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="erisds" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><image><link>http://erisds.co.uk</link><url>http://www.gravatar.com/avatar/cb82ccb3c72846f4e111348b8d5a01e5.png</url><title>Eris</title></image><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">erisds</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Spotlight: WordPress Admin Menu – Remove “Add New” pages or posts link</title>
		<link>http://erisds.co.uk/wordpress/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link</link>
		<comments>http://erisds.co.uk/wordpress/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link#comments</comments>
		<pubDate>Mon, 30 Aug 2010 16:37:34 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[spotlight]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1544</guid>
		<description><![CDATA[<img src="http://erisds.co.uk/wp-content/uploads/2010/08/wordpress_pages_menu3.png" alt="WordPress Pages Menu" title="wordpress_pages_menu3" width="154" height="201" class="alignleft size-full wp-image-1592" />Back in June I posted about <a title="Snippet: WordPress Admin - tidy dashboard widgets by role" href="http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role">tidying up the WordPress admin dashboard</a>. Recently I got a comment on that article asking if the admin menu could be altered for different users in a similar way. This turned out to be ever-so-slightly more complicated that I expected because there is no way to distinguish between the permission to edit and the permission to add a page or post. However, like most things in WordPress with a bit of graft it's usually possible!

<strong>Code Example:</strong> You can download the complete code sample with comments right here: <a href='http://erisds.co.uk/wp-content/uploads/2010/08/functions.zip'>functions.php [ZIP File]</a>


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/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-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>Back in June I posted about <a title="Snippet: WordPress Admin - tidy dashboard widgets by role" href="http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role">tidying up the WordPress admin dashboard</a>. Recently I got a comment on that article asking if the admin menu could be altered for different users in a similar way. </p>
<p>Here&#8217;s the question:</p>
<blockquote><p>Can I lose the “add new” under Pages drop down for editors? I don’t want them to have the ability to create new pages.</p></blockquote>
<p>I&#8217;ve played with the WordPress admin menu a bit before now. There are two global variables which allow you to add (although there are <a href="http://codex.wordpress.org/Adding_Administration_Menus" title="WP Codex: Adding Administration Menus">much better ways</a> to do this) and more importantly remove items from the WordPress menu. These variables are <kbd>$menu</kbd> for top-level menu groups like &#8220;Posts&#8221;, &#8220;Media&#8221; and <kbd>$submenu</kbd> for managing the sub-level items like &#8220;Add New&#8221; or &#8220;Library&#8221;. </p>
<p><img src="http://erisds.co.uk/wp-content/uploads/2010/08/wordpress_pages_menu2.png" alt="WordPress Pages Menus" title="wordpress_pages_menu2" width="154" height="201" class="alignleft size-full wp-image-1559" />In this case, we only want to remove the &#8220;Add New&#8221; sub-menu item from the pages menu, so we only need to use <kbd>$submenu</kbd>. If you use <kbd>var_dump</kbd> or <kbd>print_r</kbd> to display the contents of <kbd>$submenu</kbd> you&#8217;ll see the part of the array for the &#8220;Pages&#8221; menu looks like the snippet below. It contains two entries: one for the &#8220;Pages&#8221; listing which allows you to edit pages, and one for the &#8220;Add New&#8221; link that we want to remove. Also note: for each sub-menu item there are three pieces of information: The text to show, the capability the user must have to see this link, and the relative URL for the menu item.</p>
<p class="small"><strong>*Please note:</strong> all of the following will also work for posts. You will need to substitute the word &#8220;page(s)&#8221; for &#8220;post(s)&#8221; and follow the additional instructions. For other parts of the WordPress admin you&#8217;ll need to find the right URLs, sub menu items and capabilities. Full code example is here:  <a href='http://erisds.co.uk/wp-content/uploads/2010/08/functions.zip'>functions.php [ZIP File]</a></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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;">// $submenu array...</span><br />
&nbsp;<span style="color: #0000ff;">'edit.php?post_type=page'</span> <span style="color: #339933;">=&gt;</span> <br />
&nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><br />
&nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">5</span> <span style="color: #339933;">=&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'Pages'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'edit_pages'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'edit.php?post_type=page'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">23</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">10</span> <span style="color: #339933;">=&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'Add New'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'publish_pages'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'post-new.php?post_type=page'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">27</span><span style="color: #009900;">&#41;</span></div></div>
<p>With all this in mind, the simplest way to remove the &#8220;Add New&#8221; link from the pages menu, is to unset this part of the array before the menu is drawn. We can create a function to do this in the functions.php file, first declaring the <kbd>$submenu</kbd> global variable and then unsetting the bit that we don&#8217;t want. Finally we need to add our function to the <kbd>admin_menu</kbd> action hook so that it is called at the right time.</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 /></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;">// functions.php</span><br />
<span style="color: #000000; font-weight: bold;">function</span> modify_menu<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;">$submenu</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;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'edit.php?post_type=page'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</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;">// for posts it should be: </span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// unset($submenu['edit.php'][10]);</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">// call the function to modify the menu when the admin menu is drawn</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'modify_menu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>At first glance we&#8217;ve now achieved what we set out to do &#8211; the &#8220;Add New&#8221; link is removed from the menu, however this doesn&#8217;t really solve the underlying problem. The url for adding a new page is <kbd>post-new.php?post_type=page</kbd> and because we haven&#8217;t changed the permissions of an editor they can still access the page. Furthermore, there is also an &#8220;Add New&#8221; link at the top of &#8220;Pages&#8221; list page &#8211; so they can also still find the page easily.</p>
<p>So what we really need to do, is change the capabilities of the &#8220;editor&#8221; role. In WordPress each role has a set of &#8220;capabilities&#8221; or permissions &#8211; things they are allowed to do. The capability that allows someone with the &#8220;editor&#8221; role to access the Add New Page screen is &#8220;edit_page&#8221;, however if we remove this capability we will lose the whole &#8220;Pages&#8221; menu and also stop them being able to edit pages. </p>
<p>There is no way to use capabilities to restrict access to the Add New Page screen without also restricting access to the Pages list &#038; Edit page screen. However, we can stop people from being able to publish pages using the &#8220;publish_pages&#8221; capability &#8211; this means they can create pages but they won&#8217;t appear on the website. Although this isn&#8217;t a perfect solution, it seems like a good start.</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 /></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;">// functions.php</span><br />
<span style="color: #000000; font-weight: bold;">function</span> modify_capabilities<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;">// get the role you want to change: editor, author, contributor, subscriber</span><br />
&nbsp; <span style="color: #000088;">$editor_role</span> <span style="color: #339933;">=</span> get_role<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'editor'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000088;">$editor_role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'publish_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// for posts it should be:</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// $editor_role-&gt;remove_cap('publish_posts');</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// to add capabilities use add_cap()</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_init'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'modify_capabilities'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The above snippet shows a function which gets the &#8220;editor&#8221; role and removes the &#8220;publish_pages&#8221; capability. This is hooked into &#8220;admin_init&#8221; so that it is run on each admin page. Now when editors go to the Add New Page screen they will only be able to &#8220;Submit for review&#8221; not publish the page. So now we know how to both actually stop users from creating pages AND remove the sub-menu item. </p>
<p>Now that we&#8217;re working with capabilities, we can change our <kbd>modify_menu</kbd> function to do the same. Instead of completely unsetting the menu item, we can set the capability so that it only works if the user has the capability &#8220;publish_pages&#8221;. This is just a slightly nicer way to hide the menu item &#8211; you could grant one specific editor user the &#8220;publish_pages&#8221; capability and they would still be able to access the menu item.</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 /></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;">// functions.php</span><br />
<span style="color: #000000; font-weight: bold;">function</span> modify_menu<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;">$submenu</span><span style="color: #339933;">;</span><br />
<span style="display:block;background-color:#ffff66">&nbsp; <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'edit.php?post_type=page'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'publish_pages'</span><span style="color: #339933;">;</span><br /></span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// for posts it should be:</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// $submenu['edit.php'][10][1] = 'publish_posts';</span><br />
<span style="color: #009900;">&#125;</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'modify_menu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Next let&#8217;s get rid of that pesky &#8220;Add New&#8221; button on the Pages list screen. There doesn&#8217;t seem to be a hook we can use to do this, so instead I&#8217;ve used good ol&#8217; fashioned CSS. We check if we are on the &#8220;edit-page&#8221; screen using the <kbd>$current_screen</kbd> global variable and if the user has the &#8220;publish_pages&#8221; capability using the <kbd>current_user_can</kbd> method. Then we spit out some CSS to hide the button and hook this into admin_head to the CSS is output in a sensible place.</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 /></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;">// functions.php</span><br />
<span style="color: #000000; font-weight: bold;">function</span> hide_buttons<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;">$current_screen</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_screen</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'edit-page'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'publish_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;style&gt;.add-new-h2{display: none;}&lt;/style&gt;'</span><span style="color: #339933;">;</span> &nbsp;<br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// for posts the if statement would be:</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// if($current_screen-&gt;id == 'edit-post' &amp;&amp; !current_user_can('publish_posts'))</span><br />
<span style="color: #009900;">&#125;</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_head'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'hide_buttons'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Now we have editors which cannot see the &#8220;Add New&#8221; link in the Pages menu, or the button on the Pages screen, so there&#8217;s no easy way for them to get there. Even if they are clever enough to figure out the URL they won&#8217;t actually be able to publish their pages. However if we want to go the whole hog, we can add a bit more code to redirect them from the Add New Page screen and show them an error message.</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 /></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;">// functions.php</span><br />
<span style="color: #000000; font-weight: bold;">function</span> permissions_admin_redirect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/stripos"><span style="color: #990000;">stripos</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post-new.php?post_type=page'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// for posts result should be: &nbsp;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// $result = stripos($_SERVER['REQUEST_URI'], 'post-new.php');</span><br />
&nbsp; <br />
&nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'publish_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; wp_redirect<span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/wp-admin/index.php?permissions_error=true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// for posts the if statement should be:</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// if ($result!==false &amp;&amp; !current_user_can('publish_posts')) {</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'permissions_admin_redirect'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The above is an additional function to test the current request URI. If it matches the Add New Page screen AND the user doesn&#8217;t have the &#8220;publish_page&#8221; capability we redirect them to the admin dashboard. The dashboard URL is <kbd>/wp-admin/index.php</kbd>, but I&#8217;ve added <kbd>permissions_error=true</kbd> so that WordPress will know to show an error message.</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 /></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;">// functions.php</span><br />
<span style="color: #000000; font-weight: bold;">function</span> permissions_admin_notice<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;">// use the class &quot;error&quot; for red notices, and &quot;update&quot; for yellow notices</span><br />
&nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div id='permissions-warning' class='error fade'&gt;&lt;p&gt;&lt;strong&gt;&quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'You do not have permission to access that page.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> permissions_show_notice<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'permissions_error'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_notices'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'permissions_admin_notice'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp;<br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_init'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'permissions_show_notice'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Finally, two more functions and one more action hook. The first to draw an error message / warning to the user, and the second which checks the &#8220;permissions_error&#8221; parameter and shows the error message if it is set. Now there is absolutely no way for an editor to get to the Add New Page screen, instead they will be redirected to the dashboard and shown an error.</p>
<p>So this all turned out to be ever-so-slightly more complicated that I expected because there is no way to distinguish between the permission to edit and the permission to add a page or post. However, like most things in WordPress with a bit of graft it&#8217;s usually possible! I hope this has been useful, if you got lost or  something doesn&#8217;t make sense or you know of a better way to do this <em>please</em> let me know via the comments.</p>
<p><strong>Code Example:</strong> You can download the complete code sample with comments right here: <a href='http://erisds.co.uk/wp-content/uploads/2010/08/functions.zip'>functions.php [ZIP File]</a></p>
<h3>Resources</h3>
<ul>
<li><a href="http://codex.wordpress.org/Adding_Administration_Menus" title="WP Codex: Adding Administration Menus">Adding administration menus</a></li>
<li><a href="http://hungred.com/how-to/remove-wordpress-admin-menu-affecting-wordpress-core-system/" title="Remove WordPress Admin Menu Without Affecting WordPress Core System">Remove WordPress Admin Menu Without Affecting WordPress Core System</a></li>
</ul>


<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/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-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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=MPl2AHJVLYo:9p0yKELLwSw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=MPl2AHJVLYo:9p0yKELLwSw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=MPl2AHJVLYo:9p0yKELLwSw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=MPl2AHJVLYo:9p0yKELLwSw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=MPl2AHJVLYo:9p0yKELLwSw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=MPl2AHJVLYo:9p0yKELLwSw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=MPl2AHJVLYo:9p0yKELLwSw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=MPl2AHJVLYo:9p0yKELLwSw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=MPl2AHJVLYo:9p0yKELLwSw:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snippet: Magento – Using OR and LEFT JOIN in addAttributeToFilter</title>
		<link>http://erisds.co.uk/magento/snippet-magento-using-or-and-left-join-in-addattributetofilter</link>
		<comments>http://erisds.co.uk/magento/snippet-magento-using-or-and-left-join-in-addattributetofilter#comments</comments>
		<pubDate>Thu, 29 Jul 2010 11:02:52 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[collections]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1496</guid>
		<description><![CDATA[I'm still pretty new to Magento, and am learning more about it every day. I've been trying to learn all I can about internals such as managing collections &#038; recently stumbled on trying to filter a collection by two attributes. I wanted to build a list of all products that had one OR another attribute set to certain values.


Related posts:<ol><li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-accessing-the-object-in-a-form' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Accessing the Object in a Form'>Snippet: Symfony Forms &#8211; Accessing the Object in a Form</a><small>Perusing my Google Analytics data shows up some interesting results....</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>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-propel-queries-with-sql-functions' rel='bookmark' title='Permanent Link: Snippet: Symfony &#038; Propel &#8211; Queries with SQL functions'>Snippet: Symfony &#038; Propel &#8211; Queries with SQL functions</a><small>This is a super short snippet that I ALWAYS forget...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still pretty new to Magento, and am learning more about it every day. I&#8217;ve been trying to learn all I can about internals such as managing collections &#038; recently stumbled on trying to filter a collection by two attributes. I wanted to build a list of all products that had one OR another attribute set to certain values.</p>
<p>I found lots of documentation on <kbd>addAttributeToFilter</kbd> that showed how to add several filters creating an &#8220;AND&#8221; relationship and also examples how to test if a single attribute had one value or another. Perhaps it&#8217;s just me, but I always find it hard to find documentation on how to do anything more complex than the basics in Magento!</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 /></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;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _prepareCollection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000088;">$collection</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/product'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000088;">$collection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttributeToFilter</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'attribute'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'my_attribute'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'eq'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'attribute'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'my_other_attribute'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'neq'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'left'</span><br />
&nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>After a bit of playing I found you can pass nested arrays with different attribute values to create the &#8220;OR&#8221; relationship in the generated SQL. To get this working correctly I also had to pass &#8220;left&#8221; as the final parameter to make Magento use left joins rather than cross joins. It&#8217;s neat and tidy once you know it, but a bit awkward to figure out if you don&#8217;t!</p>
<p class="small"><strong>A Note on Snippets:</strong> To me Magento is a mind boggling world of abstraction, configuration and depths of potential knowledge. I find the documentation less than helpful and 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/symfony/snippet-symfony-forms-accessing-the-object-in-a-form' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Accessing the Object in a Form'>Snippet: Symfony Forms &#8211; Accessing the Object in a Form</a><small>Perusing my Google Analytics data shows up some interesting results....</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>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-propel-queries-with-sql-functions' rel='bookmark' title='Permanent Link: Snippet: Symfony &#038; Propel &#8211; Queries with SQL functions'>Snippet: Symfony &#038; Propel &#8211; Queries with SQL functions</a><small>This is a super short snippet that I ALWAYS forget...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=c8RE8Y6NJTo:sCzS2bF_pcs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=c8RE8Y6NJTo:sCzS2bF_pcs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=c8RE8Y6NJTo:sCzS2bF_pcs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=c8RE8Y6NJTo:sCzS2bF_pcs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=c8RE8Y6NJTo:sCzS2bF_pcs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=c8RE8Y6NJTo:sCzS2bF_pcs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=c8RE8Y6NJTo:sCzS2bF_pcs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=c8RE8Y6NJTo:sCzS2bF_pcs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=c8RE8Y6NJTo:sCzS2bF_pcs:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/magento/snippet-magento-using-or-and-left-join-in-addattributetofilter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snippet: Symfony &amp; Propel – Queries with SQL functions</title>
		<link>http://erisds.co.uk/symfony/snippet-symfony-propel-queries-with-sql-functions</link>
		<comments>http://erisds.co.uk/symfony/snippet-symfony-propel-queries-with-sql-functions#comments</comments>
		<pubDate>Fri, 23 Jul 2010 12:40:41 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[criteria]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1498</guid>
		<description><![CDATA[This is a super short snippet that I <em>ALWAYS</em> forget how to do! Often I want to build more complex where clauses with Propel Criteria which use SQL functions such as UCASE, LCASE, LEN and the date functions DAY, MONTH and YEAR. This is possible using Propel &#038; Criteria, but how to do it is not immediately obvious.

The snippet below shows how to select objects from the database which were created in a specific month and year. Using Criteria::CUSTOM, it's possible to specify a column and a comparison to do with that column. This is quite useful for doing things like building archive lists. 

[cc lang="php"]
$c->add(MyObjPeer::CREATED_AT, 'MONTH('.MyObjPeer::CREATED_AT.')='. $month, Criteria::CUSTOM);
$c->addAnd(MyObjPeer::CREATED_AT, 'YEAR('.MyObjPeer::CREATED_AT.')='. $year, Criteria::CUSTOM);
[/cc]


Related posts:<ol><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>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-the-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting the Form Formatter'>Snippet: Symfony Forms &#8211; Setting the Form Formatter</a><small>By default Symfony displays forms in tables, with each new...</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-definition-list-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Definition List Form Formatter'>Snippet: Symfony Forms &#8211; Definition List Form Formatter</a><small>Back in April I posted a Snippet on Symfony Form...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a super short snippet that I <em>ALWAYS</em> forget how to do! Often I want to build more complex where clauses with <a href="http://www.propelorm.org/wiki/Development/Criteria" title="Propel Criteria Documentation">Propel Criteria</a> which use SQL functions such as UCASE, LCASE, LEN and the date functions DAY, MONTH and YEAR. This is possible using Propel &#038; Criteria, but how to do it is not immediately obvious.</p>
<p>The snippet below shows how to select objects from the database which were created in a specific month and year. Using <kbd>Criteria::CUSTOM</kbd>, it&#8217;s possible to specify a column and a comparison to do with that column. This is quite useful for doing things like building archive lists.</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 /></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: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span>MyObjPeer<span style="color: #339933;">::</span><span style="color: #004000;">CREATED_AT</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'MONTH('</span><span style="color: #339933;">.</span>MyObjPeer<span style="color: #339933;">::</span><span style="color: #004000;">CREATED_AT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')='</span><span style="color: #339933;">.</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> Criteria<span style="color: #339933;">::</span><span style="color: #004000;">CUSTOM</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAnd</span><span style="color: #009900;">&#40;</span>MyObjPeer<span style="color: #339933;">::</span><span style="color: #004000;">CREATED_AT</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YEAR('</span><span style="color: #339933;">.</span>MyObjPeer<span style="color: #339933;">::</span><span style="color: #004000;">CREATED_AT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')='</span><span style="color: #339933;">.</span> <span style="color: #000088;">$year</span><span style="color: #339933;">,</span> Criteria<span style="color: #339933;">::</span><span style="color: #004000;">CUSTOM</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p class="small"><strong>A Note on Snippets:</strong> When using frameworks such as Symfony 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/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>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-the-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting the Form Formatter'>Snippet: Symfony Forms &#8211; Setting the Form Formatter</a><small>By default Symfony displays forms in tables, with each new...</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-definition-list-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Definition List Form Formatter'>Snippet: Symfony Forms &#8211; Definition List Form Formatter</a><small>Back in April I posted a Snippet on Symfony Form...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=2VaHqauV9WU:xo-fsKkJkpg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=2VaHqauV9WU:xo-fsKkJkpg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=2VaHqauV9WU:xo-fsKkJkpg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=2VaHqauV9WU:xo-fsKkJkpg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=2VaHqauV9WU:xo-fsKkJkpg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=2VaHqauV9WU:xo-fsKkJkpg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=2VaHqauV9WU:xo-fsKkJkpg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=2VaHqauV9WU:xo-fsKkJkpg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=2VaHqauV9WU:xo-fsKkJkpg:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/symfony/snippet-symfony-propel-queries-with-sql-functions/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Future of Web Design London 2010: My thoughts two months on…</title>
		<link>http://erisds.co.uk/business/future-of-web-design-my-thoughts-two-months-on</link>
		<comments>http://erisds.co.uk/business/future-of-web-design-my-thoughts-two-months-on#comments</comments>
		<pubDate>Mon, 19 Jul 2010 12:43:16 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1320</guid>
		<description><![CDATA[<img src="http://erisds.co.uk/wp-content/uploads/2010/07/fowd-e1278418726961-300x300.png" alt="" title="fowd" width="300" height="300" class="alignleft size-medium wp-image-1416" />Technology conferences are fun, an enormous amount of extremely geeky fun. Most folks can't wait to get home and blog about all the wonderful things they've seen, heard and learnt over the duration of the conference. Those reviews are great insights into what works and what doesn't, but are they an accurate reflection of the long-term benefits web industry professionals can gain from attending conferences?

Two months on and I'm still reeling from my single day experience of the Future of Web Design Conference. I shared a ticket with colleague and so attended the party &#38; second day of the conference, having the chance to meet some awesome people and learn a great deal. I highly recommend attending the <abbr title="Future of Web Design">FOWD</abbr> conference and these are my reasons why.


Related posts:<ol><li><a href='http://erisds.co.uk/business/how-to-solve-problematic-client-relationships-back-to-basics' rel='bookmark' title='Permanent Link: How to Solve Problematic Client Relationships: Back to Basics'>How to Solve Problematic Client Relationships: Back to Basics</a><small>Please Note: This is the companion blog post to a...</small></li>
<li><a href='http://erisds.co.uk/internet/the-explicitweb-podcast' rel='bookmark' title='Permanent Link: The ExplicitWeb Podcast'>The ExplicitWeb Podcast</a><small>Last week marked the launch of the 7th ExplicitWeb podcast,...</small></li>
<li><a href='http://erisds.co.uk/magento/snippet-magento-using-or-and-left-join-in-addattributetofilter' rel='bookmark' title='Permanent Link: Snippet: Magento &#8211; Using OR and LEFT JOIN in addAttributeToFilter'>Snippet: Magento &#8211; Using OR and LEFT JOIN in addAttributeToFilter</a><small>I'm still pretty new to Magento, and am learning more...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://erisds.co.uk/wp-content/uploads/2010/07/fowd-e1278418726961-300x300.png" alt="" title="fowd" width="300" height="300" class="alignleft size-medium wp-image-1416" />Technology conferences are fun, an enormous amount of extremely geeky fun. Most folks can&#8217;t wait to get home and blog about all the wonderful things they&#8217;ve seen, heard and learnt over the duration of the conference. Those reviews are great insights into what works and what doesn&#8217;t, but are they an accurate reflection of the long-term benefits web industry professionals can gain from attending conferences?</p>
<p>Two months on and I&#8217;m still reeling from my single day experience of the Future of Web Design Conference. I shared a ticket with colleague and so attended the party &amp; second day of the conference, having the chance to meet some awesome people and learn a great deal. I highly recommend attending the <abbr title="Future of Web Design">FOWD</abbr> conference and these are my reasons why.</p>
<h2>The benefits of attending <abbr title="Future of Web Design">FOWD</abbr></h2>
<p>When I left University and started working full time as a web developer a little less than 2 years ago, I had a strong academic background in computer science and business. The first 15 months of work were spent learning how all my know-how applied in the real world where great theory and best practice often get sidelined to make the realities work in practice (and in budget). Back in May, when the conference was held, I had just started working with my colleagues to develop better working practices and improve the services we offer.</p>
<p>I spent my day at the <a href="http://www.futureofwebdesign.com/london-2010" title="Future of Web Design London 2010">Future of Web Design London 2010</a> listening to top class individuals share their experiences of how to make things work in the real world, how to be more efficient and more importantly improve the services and end product that clients receive. Whilst I listened, I reflected on my own experiences and was also reminded of the theories and best practices I&#8217;d learnt at University before the real world kicked in. I was also given the opportunity to talk to highly experience professionals about their experiences and share my own ideas of how to <a title="How to Solve Problematic Client Relationships: Back to Basics" href="http://erisds.co.uk/business/how-to-solve-problematic-client-relationships-back-to-basics">better manage and improve relationships with clients</a>.</p>
<p>In essence I was able to review all that I had learned and come up with better ways to do what we do. I realised that my job is NOT about just delivering what&#8217;s possible for the client&#8217;s budget but about selling the bigger and better ideas to clients. This may be another theoretical idealism but there are two key points to achieving this goal.</p>
<p>Firstly, <strong>iterate</strong>. Break a project down in to manageable steps (for development and for budget) and continuously iterate and improve a project as budget, time, and technology constraints allow. Secondly, <strong>be data driven</strong>. Be proactive, source out new ways to develop &amp; improve, and use analytical data as evidence to support new ideas. By breaking down projects into bite-sized, evidenced steps, clients are more likely to buy-in to your ideas and as the ROI builds hopefully so will their willingness to try new things.</p>
<p>So here I am, two months after the conference and still feeling completely re-inspired. I&#8217;ve found a direction and a clear picture of what I want to be doing in 5 years. I&#8217;ve found a new passion in Analytics and I&#8217;ve fallen back in love with my job. I&#8217;m pretty sure all of these things are worth far more than the cost of a one day <abbr title="Future of Web Design">FOWD</abbr> pass.</p>
<h2>Top tips for conference attending</h2>
<p>If you are thinking about attending an event like <abbr title="Future of Web Design">FOWD</abbr>, or sending some of your staff to a conference I do recommend the following:</p>
<ul>
<li>It&#8217;s only worth attending with an open mind and a willingness to learn.</li>
<li>Don&#8217;t bother taking notes. Everything is available online afterwards so spend your time absorbing and reflecting. You&#8217;ll come away with far more insights.</li>
<li>Take the opportunity to talk to your peers and your heroes. Don&#8217;t waste time being shy, you will learn far more by engaging with the people you respect.</li>
<li>If you are sending staff, make them aware they will have an opportunity to feedback their findings afterwards &#8211; this will give them more purpose.</li>
<li>Go with the intention to have a lot of fun, and don&#8217;t feel guilty for it!</li>
</ul>
<h2>My top 3 FOWD London 2010 talks</h2>
<ol>
<li>Brett Welch &#8211; Rethink Your Job (and Earn More Money)</li>
<li>Dan Rubin &#8211; Blending Usability Testing with Interface Design, Prototyping and Rapid Iteration</li>
<li>Niamh Phelan &#8211; Google Analytics Masterclass</li>
</ol>
<p><strong>UPDATE:</strong> You can still get the <abbr title="Future of Web Design">FOWD</abbr> London 2010 <a title="Future of Web design London 2010 video pass" href="http://futureofwebdesign.com/london-2010/register/">video pass</a> to watch these talks.</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/business/how-to-solve-problematic-client-relationships-back-to-basics' rel='bookmark' title='Permanent Link: How to Solve Problematic Client Relationships: Back to Basics'>How to Solve Problematic Client Relationships: Back to Basics</a><small>Please Note: This is the companion blog post to a...</small></li>
<li><a href='http://erisds.co.uk/internet/the-explicitweb-podcast' rel='bookmark' title='Permanent Link: The ExplicitWeb Podcast'>The ExplicitWeb Podcast</a><small>Last week marked the launch of the 7th ExplicitWeb podcast,...</small></li>
<li><a href='http://erisds.co.uk/magento/snippet-magento-using-or-and-left-join-in-addattributetofilter' rel='bookmark' title='Permanent Link: Snippet: Magento &#8211; Using OR and LEFT JOIN in addAttributeToFilter'>Snippet: Magento &#8211; Using OR and LEFT JOIN in addAttributeToFilter</a><small>I'm still pretty new to Magento, and am learning more...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=7j1w9c4caYs:aCvAUgAm5Pc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=7j1w9c4caYs:aCvAUgAm5Pc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=7j1w9c4caYs:aCvAUgAm5Pc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=7j1w9c4caYs:aCvAUgAm5Pc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=7j1w9c4caYs:aCvAUgAm5Pc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=7j1w9c4caYs:aCvAUgAm5Pc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=7j1w9c4caYs:aCvAUgAm5Pc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=7j1w9c4caYs:aCvAUgAm5Pc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=7j1w9c4caYs:aCvAUgAm5Pc:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/business/future-of-web-design-my-thoughts-two-months-on/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Getting Rid of Non Breaking Spaces (&amp;nbsp)</title>
		<link>http://erisds.co.uk/code/getting-rid-of-non-breaking-spaces-nbsp</link>
		<comments>http://erisds.co.uk/code/getting-rid-of-non-breaking-spaces-nbsp#comments</comments>
		<pubDate>Tue, 13 Jul 2010 12:12:54 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1322</guid>
		<description><![CDATA[Have you ever tried to parse, process or preg_replace some HTML? Ever tried to do it when the HTML is UTF-8 encoded? Getting rid of white space can be tricky, here's a few tricks I've learned.


Related posts:<ol><li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 1'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 1</a><small>Welcome to my first JavaScript related post! I'm currently in...</small></li>
<li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 2'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 2</a><small>Welcome to Part 2 of my YUI Carousel series. If...</small></li>
<li><a href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a><small>Generally, when I find something interesting I use twitter &...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to parse, process or preg_replace some HTML? Ever tried to do it when the HTML is UTF-8 encoded? Getting rid of white space can be tricky, here&#8217;s a few tricks I&#8217;ve learned.</p>
<p>I was playing around with debugging some HTML output from <a href="http://erisds.co.uk/category/symfony" title="Other articles about Symfony">Symfony</a> the other day. The HTML was dynamic content added through <a href="http://tinymce.moxiecode.com/">TinyMCE</a> and I needed to clean superfluous formatting so that the content output looked right. I hate regular expressions and this is the first time I&#8217;ve really needed to delve into them properly, so I totally hit a stumbling block when trying to get rid of &amp;nbsp; and other bits of whitespace.</p>
<p>I tried various methods of decoding the content first, to no avail. It turns out the answer is to look for the encoded characters. I found it quite tricky to discover what the encoded values for the white space were and also to detect exactly what white space characters were present, but hopefully these two tips will help you.</p>
<h2>UTF-8 representations of white space characters</h2>
<p>The following are common white space characters. If you&#8217;re missing a few, try out <a title="File Format Character Reference" href="http://www.fileformat.info/info/unicode/char/search.htm" target="_blank">File Format for finding character codes</a>. </p>
<blockquote><p>
\x20 &#8211; The standard space or &#8216;\s&#8217;<br />
\xC2\xA0 &#8211; The non-breaking space &#8216;&amp;nbsp;&#8217;<br />
\x0D &#8211; Carriage Return or &#8216;\r&#8217;<br />
\x0A &#8211; New Line or &#8216;\n&#8217;<br />
\x09 &#8211; The tab or &#8216;\t&#8217;
</p></blockquote>
<h2>Discovering which characters are present</h2>
<p>Figuring out exactly what white space characters are present in your encoded HTML can be tricky. I used <a href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm">XVI32</a>, which is a hex editor. If you view the source of the HTML you are trying to clean and copy &#038; paste an offending section into the right-hand window it will show the encoded characters in the left hand window.  </p>
<p><img src="http://erisds.co.uk/wp-content/uploads/2010/07/xvi32.png" alt="" title="xvi32" width="560" height="411" class="aligncenter size-full wp-image-1471" /></p>
<p>Hopefully this post might save you some time. If you have a similar problem that isn&#8217;t covered here, I&#8217;d be interested to know so <a href="#respond-box" title="leave a comment">drop me a comment!</a></p>
<p><ins datetime="2010-07-19T19:29:28+00:00"><strong>Update:</strong> I thought it would be helpful to add an example of how I used these character codes. This simple function replaces all encoded non-breaking spaces with a normal space. It&#8217;s only a small snippet, but it might be of use ;).</ins></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> cleanNonBreakingSpaces<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\xC2\xA0/'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>You could replace the space with an encoded &#8220;normal&#8221; space character, although I&#8217;m not sure how well that will work:</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 /></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: #000088;">$text</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\xC2\xA0/'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'\x20'</span><span style="color: #339933;">,</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Or you could check for both encoded or non-encoded non-breaking spaces:</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 /></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: #000088;">$text</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(\xC2\xA0/|&amp;nbsp;)'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h3>Resources</h3>
<ul>
<li><a title="File Format Character Reference" href="http://www.fileformat.info/info/unicode/char/search.htm" target="_blank">File Format</a> &#8211; An excellent site for looking up character codes.</li>
<li><a title="XVI32 Freeware Hex Editor" href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm">XVI Freeware Hex Editor</a> &#8211; A great tool for discovering hidden characters.</li>
</ul>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 1'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 1</a><small>Welcome to my first JavaScript related post! I'm currently in...</small></li>
<li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 2'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 2</a><small>Welcome to Part 2 of my YUI Carousel series. If...</small></li>
<li><a href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a><small>Generally, when I find something interesting I use twitter &...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=irtf9H7YUvE:EDqzph59uTU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=irtf9H7YUvE:EDqzph59uTU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=irtf9H7YUvE:EDqzph59uTU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=irtf9H7YUvE:EDqzph59uTU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=irtf9H7YUvE:EDqzph59uTU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=irtf9H7YUvE:EDqzph59uTU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=irtf9H7YUvE:EDqzph59uTU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=irtf9H7YUvE:EDqzph59uTU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=irtf9H7YUvE:EDqzph59uTU:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/code/getting-rid-of-non-breaking-spaces-nbsp/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Snippet: Symfony Forms – Accessing the Object in a Form</title>
		<link>http://erisds.co.uk/symfony/snippet-symfony-forms-accessing-the-object-in-a-form</link>
		<comments>http://erisds.co.uk/symfony/snippet-symfony-forms-accessing-the-object-in-a-form#comments</comments>
		<pubDate>Thu, 08 Jul 2010 10:23:29 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1344</guid>
		<description><![CDATA[Perusing my Google Analytics data shows up some interesting results. For starters the top search query which sends people to my blog is "symfony accessing object in a form". This has been consistent for several months, but there is no article on my blog which answers that question. I imagine this must be very frustrating for people so it's about time I added the answer here as a snippet.


Related posts:<ol><li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-the-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting the Form Formatter'>Snippet: Symfony Forms &#8211; Setting the Form Formatter</a><small>By default Symfony displays forms in tables, with each new...</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-default-values' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting Default Values'>Snippet: Symfony Forms &#8211; Setting Default Values</a><small>I often forget how to set default values for form...</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-definition-list-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Definition List Form Formatter'>Snippet: Symfony Forms &#8211; Definition List Form Formatter</a><small>Back in April I posted a Snippet on Symfony Form...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Perusing my Google Analytics data shows up some interesting results. For starters the top search query which sends people to my blog is <strong>&#8220;symfony accessing object in a form&#8221;</strong>. This has been consistent for several months, but there is no article on my blog which answers that question. I imagine this must be very frustrating for people so it&#8217;s about time I added the answer here as a snippet.</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: #666666; font-style: italic;">// lib/form/MyObjectForm.class.php</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000088;">$myobject</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>In a form class <kbd>$this</kbd> refers to the form. Both <kbd>sfFormPropel</kbd> and <kbd>sfFormDoctrine</kbd> have the method <kbd>getObject()</kbd> which will return the object associated with the form. In Symfony, the form ALWAYS has an object associated with it, as even if you don&#8217;t pass it one, the form setup will create and associate a new (unsaved) object.</p>
<p>On the <a href="http://erisds.co.uk/symfony/snippet-symfony-forms-setting-default-values">default values snippet</a>, I was asked how to set default values for a form in an action. If you want default values for the form, you can set them in the form class as explained in that snippet, or if you want the object to have a default value, override the model with constants (or provide them in your schema).</p>
<p>If you want to pass <strong>preset values</strong> to the form in your <kbd>actions.class.php</kbd> you can do so when you create the form. The constructors for both <a href="http://www.propelorm.org/" target="_blank" title="Propel ORM">Propel</a> and <a href="http://www.doctrine-project.org/" target="_blank" title="Doctrine ORM">Doctrine</a> forms take an object as an argument which the ORM will then use as the associated object. Therefore you can create a new object, assign the values you want and then pass the object to the form 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 />6<br />7<br />8<br />9<br />10<br />11<br />12<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;">&lt;?php</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//apps/myApp/modules/myModule/actions/actions.class.php</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeMyAction<span style="color: #009900;">&#40;</span>sfWebRequest <span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// create an object for the form</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$myobject</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// object already has default values, or to set additional ones:</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$myobject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Default'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">// instantiate the new form with it's object</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyObjectForm<span style="color: #009900;">&#40;</span><span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p><ins datetime="2010-07-10T13:34:03+00:00">
<p><strong>Update:</strong> It&#8217;s probably worth adding, if you&#8217;re looking to access the user object specifically, I have more detail on that in <a href="http://erisds.co.uk/symfony/snippet-symfony-user-access-the-user-object" title="Snippet: Symfony User – Access the User Object">another snippet which deals with the user object</a>.</p>
<p></ins></p>
<p>Please let me know if you have any problems with these snippets, or if you find them useful! If you are someone who has come to my blog through this or a similar search query, drop me a comment and let me know if I&#8217;ve answered the question, or if there is more that I could help with.</p>
<p class="small"><strong>A Note on Snippets:</strong> When using frameworks such as Symfony 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/symfony/snippet-symfony-forms-setting-the-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting the Form Formatter'>Snippet: Symfony Forms &#8211; Setting the Form Formatter</a><small>By default Symfony displays forms in tables, with each new...</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-default-values' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting Default Values'>Snippet: Symfony Forms &#8211; Setting Default Values</a><small>I often forget how to set default values for form...</small></li>
<li><a href='http://erisds.co.uk/symfony/snippet-symfony-forms-definition-list-form-formatter' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Definition List Form Formatter'>Snippet: Symfony Forms &#8211; Definition List Form Formatter</a><small>Back in April I posted a Snippet on Symfony Form...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=C-C1PSJVKmw:0yFt6qa6GLA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=C-C1PSJVKmw:0yFt6qa6GLA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=C-C1PSJVKmw:0yFt6qa6GLA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=C-C1PSJVKmw:0yFt6qa6GLA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=C-C1PSJVKmw:0yFt6qa6GLA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=C-C1PSJVKmw:0yFt6qa6GLA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=C-C1PSJVKmw:0yFt6qa6GLA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=C-C1PSJVKmw:0yFt6qa6GLA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=C-C1PSJVKmw:0yFt6qa6GLA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/symfony/snippet-symfony-forms-accessing-the-object-in-a-form/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrading old WordPress installs – 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=aCbUH8Z6sWU:T8rDxsb9_Jo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=aCbUH8Z6sWU:T8rDxsb9_Jo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=aCbUH8Z6sWU:T8rDxsb9_Jo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=aCbUH8Z6sWU:T8rDxsb9_Jo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=aCbUH8Z6sWU:T8rDxsb9_Jo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=aCbUH8Z6sWU:T8rDxsb9_Jo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=aCbUH8Z6sWU:T8rDxsb9_Jo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=aCbUH8Z6sWU:T8rDxsb9_Jo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=aCbUH8Z6sWU:T8rDxsb9_Jo:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></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 – 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/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link' rel='bookmark' title='Permanent Link: Spotlight: WordPress Admin Menu &#8211; Remove &#8220;Add New&#8221; pages or posts link'>Spotlight: WordPress Admin Menu &#8211; Remove &#8220;Add New&#8221; pages or posts link</a><small>Back in June I posted about tidying up the WordPress...</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>
<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>
</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/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link' rel='bookmark' title='Permanent Link: Spotlight: WordPress Admin Menu &#8211; Remove &#8220;Add New&#8221; pages or posts link'>Spotlight: WordPress Admin Menu &#8211; Remove &#8220;Add New&#8221; pages or posts link</a><small>Back in June I posted about tidying up the WordPress...</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>
<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>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=wQKqenRNbUI:_KTQwDOrVQM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=wQKqenRNbUI:_KTQwDOrVQM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=wQKqenRNbUI:_KTQwDOrVQM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=wQKqenRNbUI:_KTQwDOrVQM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=wQKqenRNbUI:_KTQwDOrVQM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=wQKqenRNbUI:_KTQwDOrVQM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=wQKqenRNbUI:_KTQwDOrVQM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=wQKqenRNbUI:_KTQwDOrVQM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=wQKqenRNbUI:_KTQwDOrVQM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/snippet-wordpress-admin-tidy-dashboard-widgets-by-role/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>5 Top Resources for Twitter Success</title>
		<link>http://erisds.co.uk/internet/5-top-resources-for-twitter-success</link>
		<comments>http://erisds.co.uk/internet/5-top-resources-for-twitter-success#comments</comments>
		<pubDate>Thu, 24 Jun 2010 22:25:38 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1324</guid>
		<description><![CDATA[I've been experimenting with developing my Twitter account for the last year or so, and this week I published 5 simple steps for getting from beginner to a successful Twitterer: <a title="Getting Started with Twitter: 5 Simple Steps" href="http://www.enginecreative.co.uk/blog/getting-started-with-twitter-5-simple-steps.html" target="_blank">Getting Started with Twitter: 5 Simple Steps</a>. The article is aimed largely at small companies and organisations who are looking to use Twitter to drive traffic to their sites and improve their Brand's reputation.


Related posts:<ol><li><a href='http://erisds.co.uk/internet/digging-twitter' rel='bookmark' title='Permanent Link: Digging Twitter'>Digging Twitter</a><small>Last night this article hit the front page of Digg....</small></li>
<li><a href='http://erisds.co.uk/personal/disneyland-here-i-come' rel='bookmark' title='Permanent Link: Disneyland, here I come!'>Disneyland, here I come!</a><small>Two weeks ago, my slightly better half had his 30th...</small></li>
<li><a href='http://erisds.co.uk/design/magic-kingdom-font-space-encounter' rel='bookmark' title='Permanent Link: Magic Kingdom Font &#8211; Space Encounter'>Magic Kingdom Font &#8211; Space Encounter</a><small>This is a pretty silly &#038; out of the norm...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with developing my Twitter account for the last year or so, and this week I published 5 simple steps for getting from beginner to a successful Twitterer: <a title="Getting Started with Twitter: 5 Simple Steps" href="http://www.enginecreative.co.uk/blog/getting-started-with-twitter-5-simple-steps.html" target="_blank">Getting Started with Twitter: 5 Simple Steps</a>. The article is aimed largely at small companies and organisations who are looking to use Twitter to drive traffic to their sites and improve their Brand&#8217;s reputation.</p>
<p>I thought I&#8217;d post a link here, as I wanted to add my top 5 resources. The following 5 articles go into more depth regarding what Twitter is about, do&#8217;s and dont&#8217;s and how to make best use of the service. Enjoy!</p>
<ol>
<li><a rel="bookmark" href="http://stoneatwine.wordpress.com/2010/03/10/twitter-glossary-15-common-twitter-terms-explained/">Twitter Glossary – 15 Common Twitter Terms Explained</a></li>
<li><a rel="bookmark" href="http://stoneatwine.wordpress.com/2010/03/10/twitter-glossary-15-common-twitter-terms-explained/"></a><a title="Practical 101s: Getting started with Twitter" href="http://davefleet.com/2008/10/practical-101s-getting-started-with-twitter/" target="_blank">Practical 101s: Getting started with Twitter &#8211; from Dave Flee</a>t</li>
<li> <a title=" My Twitter Rules: What Not To Do" href="http://john.onolan.org/my-twitter-rules-what-not-to-do/" target="_blank">My Twitter Rules : What not to do - from John O&#8217;Nolan</a></li>
<li><a title=" My Twitter Rules: What Not To Do" href="http://john.onolan.org/my-twitter-rules-what-not-to-do/" target="_blank"></a><a title="7 Ways to Use Microblogging Services for Traffic and Brand Exposure" href="http://www.doshdosh.com/7-ways-to-use-microblogging-services-for-traffic-and-brand-exposure/" target="_blank">7 ways to use Microblogging Services for Traffic and Brand Exposure &#8211; from DoshDosh</a></li>
<li><a title="7 Ways to Use Microblogging Services for Traffic and Brand Exposure" href="http://www.doshdosh.com/7-ways-to-use-microblogging-services-for-traffic-and-brand-exposure/" target="_blank"></a><a title="How to Track your Success (or Failure) on Twitter" href="http://rich-page.com/ramblings/how-to-track-your-success-or-failure-on-twitter/" target="_blank">How to Track your Success or Failure on Twitter &#8211; from Rich Page</a></li>
</ol>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/internet/digging-twitter' rel='bookmark' title='Permanent Link: Digging Twitter'>Digging Twitter</a><small>Last night this article hit the front page of Digg....</small></li>
<li><a href='http://erisds.co.uk/personal/disneyland-here-i-come' rel='bookmark' title='Permanent Link: Disneyland, here I come!'>Disneyland, here I come!</a><small>Two weeks ago, my slightly better half had his 30th...</small></li>
<li><a href='http://erisds.co.uk/design/magic-kingdom-font-space-encounter' rel='bookmark' title='Permanent Link: Magic Kingdom Font &#8211; Space Encounter'>Magic Kingdom Font &#8211; Space Encounter</a><small>This is a pretty silly &#038; out of the norm...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=ifcsKogJwMA:ASxpYVoDwU0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=ifcsKogJwMA:ASxpYVoDwU0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=ifcsKogJwMA:ASxpYVoDwU0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=ifcsKogJwMA:ASxpYVoDwU0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=ifcsKogJwMA:ASxpYVoDwU0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=ifcsKogJwMA:ASxpYVoDwU0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=ifcsKogJwMA:ASxpYVoDwU0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=ifcsKogJwMA:ASxpYVoDwU0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=ifcsKogJwMA:ASxpYVoDwU0:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/internet/5-top-resources-for-twitter-success/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The ExplicitWeb Podcast</title>
		<link>http://erisds.co.uk/internet/the-explicitweb-podcast</link>
		<comments>http://erisds.co.uk/internet/the-explicitweb-podcast#comments</comments>
		<pubDate>Sun, 20 Jun 2010 10:50:20 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[explicitweb]]></category>
		<category><![CDATA[featured]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=1188</guid>
		<description><![CDATA[<a href="http://explicitweb.co.uk"><img class="alignleft size-medium wp-image-1305" title="ExplicitWeb" src="http://erisds.co.uk/wp-content/uploads/2010/06/explicitweb_logo-300x300.jpg" alt="" width="300" height="300" /></a>Last week marked the launch of the <a title="Ep. 7 of Explicit Web - Content vs. Design, Microformats, Working in Bursts, and the iPad" href="http://explicitweb.co.uk/post/697393363/episode-7-content-vs-design-microformats" target="_blank">7th ExplicitWeb podcast</a>, complete with our second guest, Rick Nunn. The show seems to be gathering strength with each new episode and I thought it about time I shared my thoughts. If you haven't heard the podcast yet, I recommend checking us out either at the <a title="ExplictWeb Podcast " href="http://explicitweb.co.uk/" target="_blank">ExplicitWeb site</a> or our page on <a title="Explicit Web on iTunes" href="http://bit.ly/cun27g" target="_blank">iTunes</a>.

Just a quick post on the origins of the podcast, the idea behind it and why it is the way it is!


Related posts:<ol><li><a href='http://erisds.co.uk/business/how-to-solve-problematic-client-relationships-back-to-basics' rel='bookmark' title='Permanent Link: How to Solve Problematic Client Relationships: Back to Basics'>How to Solve Problematic Client Relationships: Back to Basics</a><small>Please Note: This is the companion blog post to a...</small></li>
<li><a href='http://erisds.co.uk/code/html-canvas-going-ninja-with-net-magazines-processing-js-tutorial' rel='bookmark' title='Permanent Link: HTML Canvas: Going Ninja with .Net Magazine&#8217;s Processing.js tutorial'>HTML Canvas: Going Ninja with .Net Magazine&#8217;s Processing.js tutorial</a><small>Yesterday I finally got around to sitting down with the...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://explicitweb.co.uk"><img class="alignleft size-medium wp-image-1305" title="ExplicitWeb" src="http://erisds.co.uk/wp-content/uploads/2010/06/explicitweb_logo-300x300.jpg" alt="" width="300" height="300" /></a>Last week marked the launch of the <a title="Ep. 7 of Explicit Web - Content vs. Design, Microformats, Working in Bursts, and the iPad" href="http://explicitweb.co.uk/post/697393363/episode-7-content-vs-design-microformats" target="_blank">7th ExplicitWeb podcast</a>, complete with our second guest, Rick Nunn. The show seems to be gathering strength with each new episode and I thought it about time I shared my thoughts. If you haven&#8217;t heard the podcast yet, I recommend checking us out either at the <a title="ExplictWeb Podcast " href="http://explicitweb.co.uk/" target="_blank">ExplicitWeb site</a> or our page on <a title="Explicit Web on iTunes" href="http://bit.ly/cun27g" target="_blank">iTunes</a>.</p>
<p>ExplicitWeb came from a series of conversations between <a title="John O'Nolan on ExplicitWeb" href="http://john.onolan.org/the-explicitweb-podcast/" target="_blank">John O&#8217;Nolan</a>, <a title="Rob Hawkes on ExplicitWeb" href="http://rawkes.com/blog/2010/03/10/explicitweb-a-podcast-from-the-front-lines-of-web-development" target="_blank">Rob Hawkes</a> and I regarding the state of web industry podcasts. We felt that the existing podcasts were often overly long and self-indulgent, many focus on one subject per show making them hit-and-miss, and most are done by professional podcasters, or people who have become professional podcasters meaning they no longer practise web design and development on a daily basis. The three of us saw an opportunity to do something new &amp; different and <a title="ExplictWeb Podcast " href="http://explicitweb.co.uk/" target="_blank">ExplicitWeb</a> was born.</p>
<p>Doing things differently means shaking it up a bit (and invariably making some people unhappy). Here&#8217;s a few features of ExplicitWeb:</p>
<ul>
<li><strong>ExplicitWeb is short</strong> &#8211; the average show time is around 39 minutes. Hopefully this means you won&#8217;t get bored.</li>
<li><strong>ExplicitWeb is in 3 segments</strong> &#8211; each host presents a topic, meaning that in those 39-odd minutes you get 3 bite-sized looks at 3 very different subjects.</li>
<li><strong>ExplicitWeb is flexible</strong> &#8211; we regularly play with the format: one episode was a 30 minute interview and in another we added an extra segment presented by a guest. We&#8217;re open to ideas and always looking to improve.</li>
<li><strong>ExplicitWeb is diverse</strong> &#8211; we&#8217;re from agency, freelance and student backgrounds, developer, designer, and somewhere in the middle and yup we&#8217;ve even got the token girl ;)</li>
<li><strong>ExplicitWeb is informal</strong> &#8211; we try to present our topics like we&#8217;re having a chat down your local. We don&#8217;t try to be holier-than-thou and what we say comes from our real world experience in a hopefully down-to-earth way&#8230;</li>
<li><strong>ExplicitWeb is Explicit</strong> &#8211; &#8230;not because it&#8217;s smart or funny, but because that&#8217;s how we talk normally.</li>
<li><strong>ExplicitWeb is how it comes (warts and all) </strong>- we don&#8217;t censor and rarely edit. It keeps it quick &amp; easy to produce and hopefully gives the show that &#8220;in the pub&#8221; feel!</li>
<li><strong>ExplicitWeb is bi-weekly</strong> &#8211; despite our time-cutting measures we still only realistically have time to produce a show every 2 weeks. This is definitely the biggest gripe of our listeners! Honestly we&#8217;d all LOVE to have the time to do it weekly, but we don&#8217;t. Hey, at least it&#8217;s not monthly!</li>
</ul>
<p>The entire point behind <a title="ExplictWeb Podcast " href="http://explicitweb.co.uk/" target="_blank">ExplicitWeb</a> is that we are web industry professionals, not professional podcasters. We hope that the benefits of this approach outweigh the negatives. That the content we produce is better for it, even if it means less frequent shows.</p>
<p><a title="ExplicitWeb Podcast" href="http://explicitweb.co.uk" target="_blank">Check out the show</a> and if you like it please don&#8217;t forget to subscribe on <a title="Explicit Web on iTunes" href="http://bit.ly/cun27g" target="_blank">iTunes</a> or to <a title="ExplicitWeb RSS Feed" href="http://media.explicitweb.co.uk/feed/explicitweb_feed.xml" target="_blank">the feed</a> if you prefer. Whether you have positive feedback or constructive criticism, <a title="ExplicitWeb on Twitter" href="http://twitter.com/explicitweb" target="_blank">let us know</a> and maybe <a title="Vote for your favourite ExplicitWeb episode" href="http://explicitweb.co.uk/post/718005957/quick-poll-which-episode-is-your-favourite-so-far" target="_blank">vote for your favourite episode</a>? If you&#8217;ve got ideas for topics, or would like to present one yourself, <a title="ExplicitWeb on Twitter" href="http://twitter.com/explicitweb" target="_blank">get in touch</a>.</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/business/how-to-solve-problematic-client-relationships-back-to-basics' rel='bookmark' title='Permanent Link: How to Solve Problematic Client Relationships: Back to Basics'>How to Solve Problematic Client Relationships: Back to Basics</a><small>Please Note: This is the companion blog post to a...</small></li>
<li><a href='http://erisds.co.uk/code/html-canvas-going-ninja-with-net-magazines-processing-js-tutorial' rel='bookmark' title='Permanent Link: HTML Canvas: Going Ninja with .Net Magazine&#8217;s Processing.js tutorial'>HTML Canvas: Going Ninja with .Net Magazine&#8217;s Processing.js tutorial</a><small>Yesterday I finally got around to sitting down with the...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/erisds?a=d1yP4tYyCM0:h7vB2Emdd8Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/erisds?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=d1yP4tYyCM0:h7vB2Emdd8Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/erisds?i=d1yP4tYyCM0:h7vB2Emdd8Y:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=d1yP4tYyCM0:h7vB2Emdd8Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/erisds?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=d1yP4tYyCM0:h7vB2Emdd8Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/erisds?i=d1yP4tYyCM0:h7vB2Emdd8Y:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=d1yP4tYyCM0:h7vB2Emdd8Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/erisds?i=d1yP4tYyCM0:h7vB2Emdd8Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/erisds?a=d1yP4tYyCM0:h7vB2Emdd8Y:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/erisds?d=I9og5sOYxJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/internet/the-explicitweb-podcast/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
