<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Consolidate Options with Arrays in your WordPress Plugins</title>
	<atom:link href="http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/feed/" rel="self" type="application/rss+xml" />
	<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/</link>
	<description>"It's All Geek To Me"</description>
	<lastBuildDate>Mon, 05 Dec 2011 13:30:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jürgen</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2735</link>
		<dc:creator>Jürgen</dc:creator>
		<pubDate>Wed, 27 Apr 2011 17:29:49 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2735</guid>
		<description>Thank you,
I just needed that for my new plugin. It used to get overcrowded with options.
Now I put them inside an array (could have thought of that myself earlier) and done.
Jürgen</description>
		<content:encoded><![CDATA[<p>Thank you,<br />
I just needed that for my new plugin. It used to get overcrowded with options.<br />
Now I put them inside an array (could have thought of that myself earlier) and done.<br />
Jürgen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nabeel</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2727</link>
		<dc:creator>Nabeel</dc:creator>
		<pubDate>Fri, 18 Mar 2011 07:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2727</guid>
		<description>@The frosty, follow this tutorial to change array key names: http://nabtron.com/how-to-change-array-key-name-in-php/3932/

and thanks for the tutorial! it&#039;s bit lengthy btw! needed it though :) tired of creating plugins with tons of update and get_option!</description>
		<content:encoded><![CDATA[<p>@The frosty, follow this tutorial to change array key names: <a href="http://nabtron.com/how-to-change-array-key-name-in-php/3932/" >http://nabtron.com/how-to-change-array-key-name-in-php/...</a></p>
<p>and thanks for the tutorial! it&#8217;s bit lengthy btw! needed it though <img src='http://striderweb.com/nerdaphernalia/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  tired of creating plugins with tons of update and get_option!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Frosty</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2678</link>
		<dc:creator>The Frosty</dc:creator>
		<pubDate>Thu, 16 Sep 2010 17:15:25 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2678</guid>
		<description>Just curious on how to change an old array of names to new names?
I&#039;ve done this for my plugin, but a new version updates the names in  the option. Not sure on how to best migrate to the new names.
Example:

&lt;strong&gt;New:&lt;/strong&gt;
$settings = array(
		&#039;version&#039; =&gt; &#039;0.8&#039;,
		&#039;custom&#039; =&gt; false,			
		&#039;custom_css&#039; =&gt; &#039;&#039;,			
		&#039;custom_html&#039; =&gt; &#039;&#039;,
);
&lt;strong&gt;Old:&lt;/strong&gt;
$old = array(
		&#039;use_custom&#039; =&gt; false,		
		&#039;cl_login_custom_code&#039; =&gt; &#039;&#039;,	
		&#039;cl_login_custom_html_code&#039; =&gt; &#039;&#039;,
);


Not sure the best way to go about this..</description>
		<content:encoded><![CDATA[<p>Just curious on how to change an old array of names to new names?<br />
I&#8217;ve done this for my plugin, but a new version updates the names in  the option. Not sure on how to best migrate to the new names.<br />
Example:</p>
<p><strong>New:</strong><br />
$settings = array(<br />
		&#8216;version&#8217; =&gt; &#8217;0.8&#8242;,<br />
		&#8216;custom&#8217; =&gt; false,<br />
		&#8216;custom_css&#8217; =&gt; &#8221;,<br />
		&#8216;custom_html&#8217; =&gt; &#8221;,<br />
);<br />
<strong>Old:</strong><br />
$old = array(<br />
		&#8216;use_custom&#8217; =&gt; false,<br />
		&#8216;cl_login_custom_code&#8217; =&gt; &#8221;,<br />
		&#8216;cl_login_custom_html_code&#8217; =&gt; &#8221;,<br />
);</p>
<p>Not sure the best way to go about this..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Milan</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2634</link>
		<dc:creator>Milan</dc:creator>
		<pubDate>Tue, 06 Jul 2010 19:33:31 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2634</guid>
		<description>Stephen, you made mistake in &lt;a href=&quot;http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/?cp=all#comment-2178&quot;&gt;comment 12&lt;/a&gt;, value for unset should be in brackets.

Also, register_setting and add_settings_field make it even simpler to use options (with array too).</description>
		<content:encoded><![CDATA[<p>Stephen, you made mistake in <a href="http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/?cp=all#comment-2178">comment 12</a>, value for unset should be in brackets.</p>
<p>Also, register_setting and add_settings_field make it even simpler to use options (with array too).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen R</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2627</link>
		<dc:creator>Stephen R</dc:creator>
		<pubDate>Sat, 12 Jun 2010 16:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2627</guid>
		<description>Mark --

1) You&#039;re not going to overwrite anything unless you write the option back to the database.  To save changes, call the entire array, change whatever elements you want, and then you write the entire array back to the database.

2) I&#039;m pretty sure you can write an array to post_meta, though I&#039;ve never had to do such myself.

Note that if the array is *really* large, it may be good to break it up into a couple different arrays (saved to different options or meta).  Depends on the usage, but you may find that certain settings are only called in admin, for example.</description>
		<content:encoded><![CDATA[<p>Mark &#8211;</p>
<p>1) You&#8217;re not going to overwrite anything unless you write the option back to the database.  To save changes, call the entire array, change whatever elements you want, and then you write the entire array back to the database.</p>
<p>2) I&#8217;m pretty sure you can write an array to post_meta, though I&#8217;ve never had to do such myself.</p>
<p>Note that if the array is *really* large, it may be good to break it up into a couple different arrays (saved to different options or meta).  Depends on the usage, but you may find that certain settings are only called in admin, for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark @ Alchemy United</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2626</link>
		<dc:creator>Mark @ Alchemy United</dc:creator>
		<pubDate>Sat, 12 Jun 2010 11:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2626</guid>
		<description>Hey! Great stuff. Thanks, I needed this. Since I&#039;m kinda a plugin noob maybe you can help me out a bit?

1) My plugin has quite a few setting that loading up an array and storing that array in options is ideal for. But how do I not over write that array? I know that&#039;s really stupid and obvious but... Do I just test for the option existing and not reload the array (unless say, there&#039;s a reset option)? 

2) What about post_meta, can that handle an array? How might you suggest managing 30+ &quot;parms&quot; at the per post level?

Hopefully you&#039;re still keeping an eye on this thread. Thx.</description>
		<content:encoded><![CDATA[<p>Hey! Great stuff. Thanks, I needed this. Since I&#8217;m kinda a plugin noob maybe you can help me out a bit?</p>
<p>1) My plugin has quite a few setting that loading up an array and storing that array in options is ideal for. But how do I not over write that array? I know that&#8217;s really stupid and obvious but&#8230; Do I just test for the option existing and not reload the array (unless say, there&#8217;s a reset option)? </p>
<p>2) What about post_meta, can that handle an array? How might you suggest managing 30+ &#8220;parms&#8221; at the per post level?</p>
<p>Hopefully you&#8217;re still keeping an eye on this thread. Thx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesco</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2596</link>
		<dc:creator>Francesco</dc:creator>
		<pubDate>Thu, 15 Apr 2010 23:20:01 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2596</guid>
		<description>?php if(get_option(‘options_array’,&#039;key1?)==&#039;yes&#039;): ?</description>
		<content:encoded><![CDATA[<p>?php if(get_option(‘options_array’,&#8217;key1?)==&#8217;yes&#8217;): ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesco</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/comment-page-2/#comment-2595</link>
		<dc:creator>Francesco</dc:creator>
		<pubDate>Thu, 15 Apr 2010 23:19:09 +0000</pubDate>
		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78#comment-2595</guid>
		<description></description>
		<content:encoded><![CDATA[]]></content:encoded>
	</item>
</channel>
</rss>

