<blockquote style="margin: 0pt 0pt 0pt 6.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><i style="color: rgb(153, 153, 153);">The better solution would be activate/deactivate/delete hooks for
Themes; I tried to take that on for 3.2, but failed miserably. :/</i><br></blockquote><br>My previous message was more or less a solution to the problems that are inherent to activate/deactivate hooks--namely, deleting the theme's data from the DB would mean the theme options reset to their default values every time you deactivate-and-re-activate a theme. So yes, having those hooks available is a good idea, and it's something that would complement the solution I was talking about.<br>
<br><br><br><div class="gmail_quote">On Sun, Jun 12, 2011 at 9:45 PM, Doug Stewart <span dir="ltr"><<a href="mailto:zamoose@gmail.com">zamoose@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
This is spot-on. If themes are restricted to one or maybe two options<br>
in the DB, then what sense is there in creating such overbearing<br>
complexity?<br>
<div class="im"><br>
On Sun, Jun 12, 2011 at 9:34 PM, Chip Bennett <<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>> wrote:<br>
</div><div><div></div><div class="h5">> I must say: I don't really understand this rule suggestion. I don't see the<br>
> problem with setting default options, as opposed to adding in a bunch of<br>
> conditional code in the Theme template files, in order to account for unset<br>
> options.<br>
> I'm not even sure I would suggest this approach as a "best practice", given<br>
> the amount of additional code/processing that implementation would require;<br>
> setting default options is just more efficient.<br>
><br>
> We already require that Themes use an options array as the single entry in<br>
> wp_options; so we're minimizing Theme DB clutter. It's true that Theme<br>
> reviewers will have a lot of such DB entries; but I don't think we should be<br>
> making universal rules based on an incredibly niche sub-set of Theme users.<br>
> Chip<br>
><br>
> On Sun, Jun 12, 2011 at 3:26 PM, Otto <<a href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>> wrote:<br>
>><br>
>> 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('whatever',123) and there is no<br>
>> whatever option, then that will return 123.<br>
>><br>
>> Use the defaults properly. Don't set them just because they're not there.<br>
>><br>
>> -Otto<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>
><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>
><br>
<br>
<br>
<br>
</div></div>--<br>
<font color="#888888">-Doug<br>
</font><div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>