[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
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.
> 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
> > same time I'd like to stay on the safe side and use everything WordPress
> > 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
> > and x_do_settings_fields() and use those instead? They will be pretty
> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the theme-reviewers