The better solution would be activate/deactivate/delete hooks for Themes; I tried to take that on for 3.2, but failed miserably. :/<div><br></div><div>Chip<br><br><div class="gmail_quote">On Sun, Jun 12, 2011 at 9:22 PM, Darren Slatten <span dir="ltr">&lt;<a href="mailto:darrenslatten@gmail.com">darrenslatten@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I&#39;m just throwing this out there as an idea...<br><br>The best practice could simply be: Themes should not leave a footprint in the DB after they&#39;ve been deactivated.<br>
<br>In order to provide a mechanism for persisting data between activations/upgrades, theme developers could incorporate an import/export function that serializes/saves the data to a flat file. This would also provide developers with a convenient way to duplicate their theme&#39;s preferred settings across multiple sites, because the settings would be (e.g.) saved in the theme folder.<br>

<br>Are there any inherent problems with such a solution? The only thing that comes to mind is that it would introduce a point of failure in terms of security.<br><br>We might even be able to use the WP import/export functionality--I haven&#39;t looked at the code, so I don&#39;t know how difficult that would be.<br>
<font color="#888888">
<br>--Darren</font><div><div></div><div class="h5"><br><br><br><br><div class="gmail_quote">On Sun, Jun 12, 2011 at 8:34 PM, Chip Bennett <span dir="ltr">&lt;<a href="mailto:chip@chipbennett.net" target="_blank">chip@chipbennett.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I must say: I don&#39;t really understand this rule suggestion. I don&#39;t see the problem with setting default options, as opposed to adding in a bunch of conditional code in the Theme template files, in order to account for unset options.<div>


<br></div><div>I&#39;m not even sure I would suggest this approach as a &quot;best practice&quot;, given the amount of additional code/processing that implementation would require; setting default options is just more efficient.<br>


<div><br></div><div>We already require that Themes use an options array as the single entry in wp_options; so we&#39;re minimizing Theme DB clutter. It&#39;s true that Theme reviewers will have a lot of such DB entries; but I don&#39;t think we should be making universal rules based on an incredibly niche sub-set of Theme users.</div>


<div><br></div><div><font color="#888888">Chip</font><div><div></div><div><br><br><div class="gmail_quote">On Sun, Jun 12, 2011 at 3:26 PM, Otto <span dir="ltr">&lt;<a href="mailto:otto@ottodestruct.com" target="_blank">otto@ottodestruct.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is just a note about a rule that I think should be added to the<br>
theme review process:<br>
<br>
- Themes should not do anything to the database merely by virtue of<br>
being activated.<br>
<br>
By that, I mean that having a theme check for a setting, like<br>
get_option or get_theme_mod and then calling set_option or<br>
set_theme_mod to set it to some default is wrong.<br>
<br>
Both get_option and get_theme_mod accept a second parameter of a<br>
default setting. If I call get_option(&#39;whatever&#39;,123) and there is no<br>
whatever option, then that will return 123.<br>
<br>
Use the defaults properly. Don&#39;t set them just because they&#39;re not there.<br>
<font color="#888888"><br>
-Otto<br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</font></blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>