[theme-reviewers] Settings API
Shinra Web Holdings
contact at shinraholdings.com
Sat Oct 6 14:02:33 UTC 2012
If you plan on changing the options around a lot, then having custom
functions to print the pieces of your settings page makes sense. But if
you're relying on do_settings_fields() for an options page, that is
probably way outside your comfort zone.
I suggest making an array of arrays each containing the info needed for 1
option, like slug, display text, default value, input type, and options
(for select and radios). Then pass this to a function that has 5 different
printf's for text/textarea/checkbox/select/radio and loops through all your
options.
If you're going to bother to do this, you also might want to consider
saving all your theme settings to a single serialized option.
On Sat, Oct 6, 2012 at 7:11 AM, Otto <otto at ottodestruct.com> wrote:
> If you're going to create your own HTML for the settings page, then
> there's not much point in creating your own equivalent of the
> do_settings functions. Just make your own HTML in the main function.
>
> -Otto
>
>
> On Sat, Oct 6, 2012 at 3:52 AM, ethan anwar <ethananwar at yahoo.com> wrote:
> > Hello fellow theme reviewers!
> >
> > I've got a bone to pick with the Settings API. Especially with
> > do_settings_sections() and do_settings_fields() .
> > I would like to create a more advanced Settings Page for my theme but at
> the
> > same time I'd like to stay on the safe side and use everything WordPress
> has
> > to offer.
> > Unfortunately WordPress has these two functions to offer and they don't
> > really do that much.
> >
> > All that do_settings_sections() does is create a <h3> tag and a table
> > underneath it for do_settings_fields() to paste the options in. I'm not
> > happy with that.
> >
> > Basically what I'm asking is "Can I create my own
> x_do_settings_sections()
> > and x_do_settings_fields() and use those instead? They will be pretty
> much
> > the same ones as the default ones declared in
> > wp-admin/includes/template.php, only that they'll generate a little
> > different HTML (divs with ID's and classes and no tables).
> >
> > Thanks a lot!
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20121006/2b021238/attachment.htm>
More information about the theme-reviewers
mailing list