[wp-hackers] Plugin options page

Stephen Rider wp-hackers at striderweb.com
Wed Jun 13 16:48:09 GMT 2007


Sabin already covered a lot of things, but here's my 2 cents....

On Jun 13, 2007, at 9:03 AM, Jennifer Hodgdon wrote:

> Alex Günsche wrote:
>> There are many plugins that need to add options to the admin  
>> panel. For
>> many plugins, this is only some few options.

>> I wonder if WordPress could introduce an additional Options page,  
>> where
>> plugins with few options can just hook in, add their one or two  
>> options
>> in a fieldset and have their separate "Save" button (and maybe a  
>> global
>> "Save" for the page). I know that there is ./wp-admin/options.php,  
>> but
>> this is not very userfriendly.
>> Alternatively, the existing Options pages could get new hooks, so the
>> plugins could simply add their options there.

Trying to decide if I prefer the idea of adding options to the main  
options page or making a separate page.  Maybe a clearly identified  
"Third party" options section on the main page would be best?  (with  
accordion close so it doesn't get unwieldy)

> 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.

It's always nice to have options (no pun intended).  Plus, this is as  
much a question of making things nice for the end user as for the  
programmers.

> 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, rather than trying to guess which  
> regular options page the plugin author might have chosen to put  
> them on.

A good point.  As Sabin mentioned, an options link from the plugin  
page might be best.

Actually, from a user-interface standpoint, that might be the best  
way to go... what about an options page (or mini-popup) that is  
_only_ linked from the plugins page?  This would be a _very_ good  
idea for plugins with simple set-and-forget options that you only  
have to change when first activating a plugin.

> 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.

So hide it if it's empty.  It only appears if there's a plugin that  
uses it.

> c) Having two separate Save/Submit buttons on the same page seems  
> like it would be confusing.

Agreed.  I like Sabin's idea -- the options page only shows the  
header for each plugin.  When you click on it, that plugin's options  
section opens up, and has a submit button.  You can only have one  
section open at a time.

Each section should have a "name" link tag so that you can link to a  
particular plugin's section with options.php#pluginname.  A  
JavaScript perhaps can auto-open the section if it's accessed through  
such a link.


Related to all of this, there are a number of plugin authors  
(including myself) who put a link to the plugin's Options page within  
the description on the Plugins page.  Maybe we should standardize  
such a link to encourage those links.  They're _extremely_ handy when  
activating plugins so that you don't have to hunt around for the new  
Options screen.

Stephen Rider


More information about the wp-hackers mailing list