[wp-hackers] Settings pages

Stephen Rider wp-hackers at striderweb.com
Sat Jun 13 19:48:30 GMT 2009


On Jun 13, 2009, at 5:32 AM, Mike Schinkel wrote:

> "Ptah Dunbar" <pt at ptahd.com> wrote:
>> Thanks for the tips NR. I was already afraid of that after snooping
>> around the core a little bit more. And yes, everything's going into
>> one fat array (you wouldnt catch me dead adding options all over
>> the place).
>
> Something to consider. "Never" shouldn't be a hard and fast rule.   
> If you are storing record IDs or other items that can be used to  
> uniquely identify a record you should consider putting them in their  
> own option, especially if the information would be needed as a  
> linking table in a SQL query.

Absolutely. :)

I've been a strong advocate of combining option into arrays (in fact  
wrote a details article on doing just that*); but there are definitely  
times when it makes sense to break out certain settings into their own  
entry -- especially when a certain range of settings fall into a  
distinct group.  Of course there are also times when it shouldn't be  
in the Options table at all, but instead may be a field added to an  
existing table, or even an entirely new table.

Stephen

* maybe somewhat outdated as of WP 2.8, but... http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/


More information about the wp-hackers mailing list