[wp-hackers] Plugin options page
Sabin Iacob
iacobs at m0n5t3r.info
Wed Jun 13 15:55:11 GMT 2007
Jennifer Hodgdon wrote:
> Here's my 2 cents:
>
> a) I personally don't think it is much less work to have your plugin
> create its own options page, vs. adding to an existing options page.
maybe a framework for writing options pages would be nice, as their
structure is predictable enough. I wrote some "template tags" for this a
while ago and my life is a lot easier; picture how
this(http://dev.wp-plugins.org/browser/inline-gallery/trunk/options.php?format=txt)
would look written in spaghetti php...
my "template tags" are actually a way of moving ugliness out of sight,
though; the spaghetti is still there, hidden in options-lib.php. perhaps
it would be even better to do something like "register_options(plugin
name, array(type, validation pattern, etc...))" and only call
"render_options(plugin name)" to get the options page
> b) I think it is easier for the plugin user to find the plugin options
> if they are on a separate page dedicated to that plugin and named with
> the plugin name
true; however this can be addressed in the plug-in list page (add a link
to the relevant options page)
> , rather than trying to guess which regular options page the plugin
> author might have chosen to put them on. A separate generic "Plugin
> Options" page would be OK, but since most existing plugins already
> have their own options pages, it might be empty most of the time.
I have about 20 plug-ins activated (and I tried really hard to get that
number low); 3 of them have their own options page, about half of them
required some editing and setting 1 or 2 variables.
> Alternatively, if lots of plugins started using the generic "Plugin
> Options" page, it could become really long and unwieldy.
true, but this is easily fixable with javascript/ajax magic; and a long
page you are loading only when you need to change some options to a
plug-in is definitely better than a kilometre long option pages list
that wraps
> c) Having two separate Save/Submit buttons on the same page seems like
> it would be confusing.
can be solved by hiding all other plug-in options but the one currently
being configured (accordion control): the user would only see one submit
button at a time; alternatively, the plug-ins only add variables that
need to be edited to an array, and there would be only one submit button.
More information about the wp-hackers
mailing list