<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>pretty sure that’s what otto wants to avoid, since on activation that will
create those update_options in the database, he wants to use the predefined
options at all times “until” someone hits the save in the theme options. I’m
assuming because people switching themes all the time to check them out to see
if they want to use a theme – don’t want to overload the database with a bunch
of entries for themes not in use (at least that’s my reasoning why it would be
important)</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=emil@themeid.com
href="mailto:emil@themeid.com">Emil Uzelac</A> </DIV>
<DIV><B>Sent:</B> Sunday, June 12, 2011 2:41 PM</DIV>
<DIV><B>To:</B> <A title=theme-reviewers@lists.wordpress.org
href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</A>
</DIV>
<DIV><B>Subject:</B> Re: [theme-reviewers] Note to theme reviewers about
settings inthemes</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"><FONT
color=#333333><FONT size=2><FONT face=arial,helvetica,sans-serif>Or like in
Coraline Theme?<BR clear=all></FONT></FONT></FONT>
<DIV>
<DIV>
<DIV><FONT color=#333333 face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span color=#333333
face="arial, helvetica, sans-serif">
<DIV>/**</DIV>
<DIV>* Set default options</DIV>
<DIV>*/</DIV>
<DIV>function coraline_default_options() {</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>$options =
get_option( 'coraline_theme_options' );</DIV>
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>if ( ! isset(
$options['color_scheme'] ) ) {</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"
class=Apple-tab-span></SPAN>$options['color_scheme'] = 'light';</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>update_option(
'coraline_theme_options', $options );</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>}</DIV>
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>if ( ! isset(
$options['theme_layout'] ) ) {</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"
class=Apple-tab-span></SPAN>$options['theme_layout'] = 'content-sidebar';</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>update_option(
'coraline_theme_options', $options );</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>}</DIV>
<DIV>}</DIV>
<DIV>add_action( 'init', 'coraline_default_options' );</DIV></FONT></DIV>
<DIV><FONT face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT face="arial, helvetica, sans-serif"><BR></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 4:35 PM, Philip M. Hofer (Frumph)
<SPAN dir=ltr><<A
href="mailto:philip@frumph.net">philip@frumph.net</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>I am not having an issue with the that being a 'best
practice' rule., maybe not a requirement [at this time] but definitely best
practice.<BR><BR>Are you saying this?<BR><BR>$default_theme_options =
array('someoption' => true, 'someotheroption' => false);<BR>// if
'theme_options' returns false use all of the parameters from
$default_theme_options<BR>$theme_options = get_option('theme_options',
$default_theme_options);<BR><BR><BR><BR><BR>-----Original Message----- From:
Otto<BR>Sent: Sunday, June 12, 2011 1:26 PM<BR>To: WP Theme Reviewers Mailing
List<BR>Subject: [theme-reviewers] Note to theme reviewers about settings in
themes
<DIV>
<DIV></DIV>
<DIV class=h5><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"
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>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></DIV></DIV></BLOCKQUOTE></DIV>
<DIV> </DIV></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>theme-reviewers mailing
list<BR>theme-reviewers@lists.wordpress.org<BR>http://lists.wordpress.org/mailman/listinfo/theme-reviewers<BR></DIV></DIV></DIV></BODY></HTML>