<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technically speaking ... &#187; WordPress</title>
	<atom:link href="http://www.redefine.co.uk/blog/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redefine.co.uk</link>
	<description></description>
	<lastBuildDate>Mon, 17 Aug 2009 09:13:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upgrading widgets to WordPress 2.8 &#8211; solving naming conventions</title>
		<link>http://www.redefine.co.uk/blog/2009/08/17/upgrading-widgets-to-wordpress-28-solving-naming-conventions/</link>
		<comments>http://www.redefine.co.uk/blog/2009/08/17/upgrading-widgets-to-wordpress-28-solving-naming-conventions/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 09:13:57 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP 2.8]]></category>
		<category><![CDATA[WP widgets]]></category>

		<guid isPermaLink="false">http://www.redefine.co.uk/?p=99</guid>
		<description><![CDATA[<p>I&#8217;ve just been upgrading a website to WordPress 2.8 that makes great use of widgets, and was having problems with it recognising the custom widgets that I had built and had converted to use the new WP_Widget class.</p>
<p>The code that I had used as my basis had worked fine with a clean install of WP2.8 but didn&#8217;t like widgets that had been created under WP2.7.</p>
<p>An hour later of googling &#38; trawling through the source code and I was none the wiser. Then I noticed that WP_Widget automatically adds on &#8216;widget_&#8217; as a prefix to the id_base property. I had used a different naming convention when I had built custom widgets (e.g. starting them with the project or client name, such as &#8216;redefine_&#8217;&#8230;).</p>
<p>If I set the option_name property so that it was just the id_base then all of my widgets successfully reappeared in the upgraded site &#8211; but&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just been upgrading a website to WordPress 2.8 that makes great use of widgets, and was having problems with it recognising the custom widgets that I had built and had converted to use the new WP_Widget class.</p>
<p>The code that I had used as my basis had worked fine with a clean install of WP2.8 but didn&#8217;t like widgets that had been created under WP2.7.</p>
<p>An hour later of googling &amp; trawling through the source code and I was none the wiser. Then I noticed that WP_Widget automatically adds on &#8216;widget_&#8217; as a prefix to the id_base property. I had used a different naming convention when I had built custom widgets (e.g. starting them with the project or client name, such as &#8216;redefine_&#8217;&#8230;).</p>
<p>If I set the option_name property so that it was just the id_base then all of my widgets successfully reappeared in the upgraded site &#8211; but not the default WP widgets. So I was halfway there.</p>
<p>Finally I stumbled across a reference to  an alt_option_name property for WP_Widget &#8211; that was the solution to my problem. I could set that to the id_base of each my custom widgets &amp; leave the new WP_Widget class alone.</p>
<p>Hopefully this will be of use for other people who have also used a different naming convention for widgets on previous versions of WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redefine.co.uk/blog/2009/08/17/upgrading-widgets-to-wordpress-28-solving-naming-conventions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
