[theme-reviewers] Note to theme reviewers about settings in themes
Darren Slatten
darrenslatten at gmail.com
Mon Jun 13 03:09:30 UTC 2011
>
> *The better solution would be activate/deactivate/delete hooks for Themes;
> I tried to take that on for 3.2, but failed miserably. :/*
>
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.
On Sun, Jun 12, 2011 at 9:45 PM, Doug Stewart <zamoose at gmail.com> wrote:
> This is spot-on. If themes are restricted to one or maybe two options
> in the DB, then what sense is there in creating such overbearing
> complexity?
>
> On Sun, Jun 12, 2011 at 9:34 PM, Chip Bennett <chip at chipbennett.net>
> wrote:
> > I must say: I don't really understand this rule suggestion. I don'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.
> > I'm not even sure I would suggest this approach as a "best practice",
> given
> > the amount of additional code/processing that implementation would
> require;
> > setting default options is just more efficient.
> >
> > We already require that Themes use an options array as the single entry
> in
> > wp_options; so we're minimizing Theme DB clutter. It's true that Theme
> > reviewers will have a lot of such DB entries; but I don't think we should
> be
> > making universal rules based on an incredibly niche sub-set of Theme
> users.
> > Chip
> >
> > On Sun, Jun 12, 2011 at 3:26 PM, Otto <otto at ottodestruct.com> wrote:
> >>
> >> This is just a note about a rule that I think should be added to the
> >> theme review process:
> >>
> >> - Themes should not do anything to the database merely by virtue of
> >> being activated.
> >>
> >> By that, I mean that having a theme check for a setting, like
> >> get_option or get_theme_mod and then calling set_option or
> >> set_theme_mod to set it to some default is wrong.
> >>
> >> Both get_option and get_theme_mod accept a second parameter of a
> >> default setting. If I call get_option('whatever',123) and there is no
> >> whatever option, then that will return 123.
> >>
> >> Use the defaults properly. Don't set them just because they're not
> there.
> >>
> >> -Otto
> >> _______________________________________________
> >> theme-reviewers mailing list
> >> theme-reviewers at lists.wordpress.org
> >> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> >
> >
> > _______________________________________________
> > theme-reviewers mailing list
> > theme-reviewers at lists.wordpress.org
> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> >
> >
>
>
>
> --
> -Doug
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110612/d61e958f/attachment.htm>
More information about the theme-reviewers
mailing list