[wp-hackers] Need help with: coding new Plugin options
wordpress at dd32.id.au
Fri Nov 7 07:22:13 GMT 2008
On Fri, 07 Nov 2008 18:05:47 +1100, Ozh <ozh at planetozh.com> wrote:
> On Thu, Nov 6, 2008 at 10:59 PM, Otto <otto at ottodestruct.com> wrote:
>> Why would one want to point to options.php? Is there any particular
>> advantage of that?
>> I've always made my form point to itself, using action="".
> I *think* (may be wrong) that pointing to options.php auto
> stores/updates options in the db from what have been POSTed, so you
> don't have to write your own update function. The (big) downside to
> this is that it writes each setting in a single DB entry, which I
> don't like.
unless you pass your form along as an array as such:
<input type="text" name="my-plugin[field-1]" value="" />
<input type="text" name="my-plugin[field-2]" value="" />
<input type="text" name="my-plugin-admin[field-1]" value="" />
would end up with 2 options, 'my-plugin', and 'my-plugin-admin', both
being arrays, with the keys 'field-xx'
More information about the wp-hackers