[wp-hackers] Option Pages

Jeremy Clarke jer at simianuprising.com
Sat Jun 5 20:43:03 UTC 2010


On Sat, Jun 5, 2010 at 4:11 PM, Spencer <spencer.gurnk at gmail.com> wrote:

> Some very good points. I originally designed the options pages using
> meta boxes because some of the themes had a large number of things
> that needed to be changed, and I didn't like the feel of a gigantic
> page of options.  Having them in the meta boxes allowed for some
> sections to be collapsed/hidden. However, I've since recoded portions
> of those themes, and they no longer require the amount of options they
> once did.
>
>
You may also want to consider using multiple settings pages rather than one
huge one. There's no limit to how many pages you can add to manage theme
settings, so if you really have that many settings you can probably clump
them into a few groups and make useful pages to hold them. You can also
obviously create links at the top of each page to the others. This would
probably have a more possitive effect on the usability of the theme
configuration than tons of metaboxes on one giant unmanageable page.


>
> I'm also more keen to using the Settings API as it will most likely
> stay compatible with future versions of WordPress. The way I have it
> setup now, I am creating *some* of the page structure myself, which
> would eventually become out of date.
>
>
That is a very good reason to use the Settings API. The styles will always
match because very little is left in your hands except standard HTML inputs.
The Metaboxes API is excellent and futureproof but AFAIK only if you are
using it on the edit screens where they are supported. I could be wrong
here, I'm not sure how you add them to screens that aren't post editors. If
you're reverse-engineering their HTML structure and javascript then you're
asking for trouble down the line.

Another reason to use the API is that it will handle a lot of the database
stuff for you once you set it up properly. Nothing that a PHP expert
couldn't do by hand, but every line of code you don't write goes toward a
bug you avoid dealing with. It also forces you to think through various
parts of the process specifically so that you end up dealing with
security/filtering because you have no other choice.


> It just doesn't seem as fancy, but I guess those kind of pages aren't
> meant to look flashy. Sometimes stuff just needs to be straight
> forward.
>
>
WordPress is already pretty fancy but with careful consideration of
usability at every turn. As the core settings pages evolve so will your
Settings API pages, so you can depend on them always being at least as
elegant as the software you chose as a platform ;)

-- 
Jeremy Clarke
Code and Design | globalvoicesonline.org


More information about the wp-hackers mailing list