<font color="#333333"><font size="2"><font face="arial,helvetica,sans-serif">Just out of the curiosity. </font></font></font><div><font color="#333333"><font size="2"><font face="arial,helvetica,sans-serif"><br></font></font></font></div>
<div><font color="#333333"><font size="2"><font face="arial,helvetica,sans-serif">Would simple reset button via wpdb query <a href="http://codex.wordpress.org/Class_Reference/wpdb">http://codex.wordpress.org/Class_Reference/wpdb</a> be an easier idea to clean/delete data set in Theme Options? Similar to <a href="http://themeshaper.com/2010/06/03/sample-theme-options/#comment-57597">http://themeshaper.com/2010/06/03/sample-theme-options/#comment-57597</a> which is:<br clear="all">
</font></font></font><div><div><div><font face="arial, helvetica, sans-serif" color="#333333"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#333333"><meta charset="utf-8"><span class="Apple-style-span" style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; ">if( isset( $_REQUEST['reset'] )) {<br>
global $wpdb;<br>$query = "DELETE FROM $wpdb->options WHERE option_name LIKE 'option_name'";<br>$wpdb->query($query);<br>header("Location: themes.php?page=theme_options");<br>die;<br>}</span></font></div>
<div><font face="arial, helvetica, sans-serif" color="#333333"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#333333">This is copy pasted not sure if this works, but you'll get the idea.</font></div>
<div><font face="arial, helvetica, sans-serif" color="#333333"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#333333">Cheers,</font></div><div><font face="arial, helvetica, sans-serif" color="#333333">Emil</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">----</font></div><div><font face="arial, helvetica, sans-serif"><strong>Emil Uzelac</strong> | ThemeID | T: 224-444-0006 | Twitter: @EmilUzelac | E: <a href="mailto:emil@themeid.com" target="_blank">emil@themeid.com</a> | <a href="http://themeid.com/" target="_blank">http://themeid.com</a></font></div>
<div><font color="#999999" face="arial, helvetica, sans-serif">Make everything as simple as possible, but not simpler. - Albert Einstein</font></div><br>
<br><br><div class="gmail_quote">On Sun, Jun 12, 2011 at 11:43 PM, Chip Bennett <span dir="ltr"><<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Themes ideally would use a *delete* hook, not a deactivation hook, for<br>
database cleanup.<br>
<br>
Chip<br>
<div><div></div><div class="h5"><br>
On 6/12/11, Sayontan Sinha <<a href="mailto:sayontan@gmail.com">sayontan@gmail.com</a>> wrote:<br>
> I would like to add to Justin's suggestion and highlight that the uninstall<br>
> hook should be treated differently from the deactivation hook.<br>
><br>
> The problem with forcing cleanup on a deactivation hook is that occasionally<br>
> the WP servers hand out bad copies of themes (I have had that happen quite a<br>
> few times on my theme, where users sporadically report broken downloads -<br>
> the fix involved Otto rebuilding the download on the faulty server).<br>
> Depending on what got downloaded, WP either automatically deactivates the<br>
> theme (e.g. missing or broken style.css) and defaults to TwentyTen, or the<br>
> user gets a white screen (missing or broken functions.php). In the former at<br>
> least, having a deactivation hook do cleanups is fraught with the user<br>
> losing hours of work, because the switch to TwentyTen happens without the<br>
> user intending to do it.<br>
><br>
> Hence cleanup of options should be introduced only upon uninstall, and not<br>
> deactivation.<br>
><br>
> On Mon, Jun 13, 2011 at 8:10 PM, Justin Tadlock<br>
> <<a href="mailto:justin@justintadlock.com">justin@justintadlock.com</a>>wrote:<br>
><br>
>> **<br>
>> The problem with themes cleaning up after themselves is simply that<br>
>> there's<br>
>> no uninstall hook. Once we get that (plus some activate/deactivate<br>
>> hooks),<br>
>> I'd have no problem in setting some repository rules for themes to delete<br>
>> options on uninstall.<br>
>><br>
>> As far as using the $default parameter of get_option() and not setting<br>
>> defaults, that can be good practice. However, I see no reason themes<br>
>> shouldn't be setting up some defaults using add_option(). Of course,<br>
>> there's no activation hook, so some theme authors are just dropping some<br>
>> code into functions.php instead of using a hook (load-themes.php might be<br>
>> a<br>
>> good one) to auto-set default options.<br>
>><br>
>><br>
>> On 6/12/2011 10:06 PM, Emil Uzelac wrote:<br>
>><br>
>> Or for future release of WP when Theme is deleted all that was associated<br>
>> with that specific Theme gets deleted as well. Not all Authors will comply<br>
>> with WP guides and not all Themes are downloaded from the repository.<br>
>><br>
>> ----<br>
>> *Emil Uzelac* | ThemeID | T: 224-444-0006 | Twitter: @EmilUzelac | E:<br>
>> <a href="mailto:emil@themeid.com">emil@themeid.com</a> | <a href="http://themeid.com" target="_blank">http://themeid.com</a><br>
>> Make everything as simple as possible, but not simpler. - Albert Einstein<br>
>><br>
>><br>
>><br>
>> On Sun, Jun 12, 2011 at 10:03 PM, Angelo Bertolli <<br>
>> <a href="mailto:angelo.bertolli@gmail.com">angelo.bertolli@gmail.com</a>> wrote:<br>
>><br>
>>> On 6/12/2011 10:59 PM, Syahir Hakim wrote:<br>
>>><br>
>>>> I don't think it's only the theme reviewers who are installing and<br>
>>>> trying a lot of themes. It is not unusual at all for regular or<br>
>>>> first-timer WP users to try a lot of themes before they settle on one<br>
>>>> that they really like. Trying more than 10 themes is quite normal for a<br>
>>>> first-timer WP user, I think, and some of my theme users even reported<br>
>>>> that they've tried 40+ themes.<br>
>>>><br>
>>><br>
>>> It sounds like WP should have a way of forcing options to be associated<br>
>>> with their themes, and cleanup options that are independant of theme<br>
>>> code.<br>
>>> For example add_option would automatically associate the option with a<br>
>>> particular theme, maybe by directory name. Then after such a theme no<br>
>>> longer exists or is deactivated, WP presents an option to "clean up theme<br>
>>> options for theme X"<br>
>>><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>
>> theme-reviewers mailing<br>
</div></div>>> listtheme-reviewers@lists.wordpress.orghttp://<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<div class="im">>><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>
> Sayontan Sinha<br>
> <a href="http://mynethome.net" target="_blank">http://mynethome.net</a> | <a href="http://mynethome.net/blog" target="_blank">http://mynethome.net/blog</a><br>
> --<br>
> Beating Australia in Cricket is like killing a celebrity. The death gets<br>
> more coverage than the crime.<br>
><br>
<br>
</div><div class="im">--<br>
Sent from my mobile device<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">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></div></div></div>