[wp-hackers] Best way to kick off actual work from plugin settings page?

Otto otto at ottodestruct.com
Tue Jul 13 03:25:43 UTC 2010


On Mon, Jul 12, 2010 at 2:20 AM, John Blackbourn
<johnbillion+wp at gmail.com> wrote:
> On Mon, Jul 12, 2010 at 8:04 AM, Matt Jacob <matt at mattjacob.com> wrote:
>> Option #2 seems more elegant, but it's kind of overloading the purpose of
>> the callback.
>
> Not at all, this is the purpose of this callback function. I use it
> all the time to sanitize and filter the data I want saved (I also use
> a single array for all my options in a form). Option #2 is the way to
> go.

I gotta go with John on this one. Just use the callback. It's simpler,
clearer, and that's really what it's designed for.

Okay, so yes, the callback is usually used for validation. But it's
not really overloading it if you have multiple submit buttons which
you can then detect for and thus act accordingly.

-Otto


More information about the wp-hackers mailing list