[wp-hackers] Modifying admin forms via plugins

Owen Winkler ringmaster at midnightcircus.com
Tue Jun 22 21:02:30 UTC 2004


> Sure, that would avoid having to reposition.  How about 
> adding these right before the Save/Publish buttons?
> 
> do_action('edit_form_options', ''); 
> do_action('edit_form_advanced_options', '');

I think there are (at least) two issues with adding content to the admin
forms:

First, we plugin writers would like a nice, non-javascript way to get
our form elements inside the WordPress post form.

Currently, my plugin uses an action called 'wp_edit_advanced'.  I think
someone else (Zarniwoop?) might be using this, too.  What it's called
doesn't matter too much to me, nor does the fact that my positioning is
different from your suggestion.  I insert the do_action(...) just above
the </form> tag so my content appears below the custom fields fieldset.
That seemed the least intrusive, and my form can always (in fact, it
does) add an additional Submit button so the user need not scroll a lot.

The second issue is the issue of plugin configuration options.

We plugin writers would like to store our config options in the
database.  We can, and that's cool, but there is no common interface for
us to use to edit those values, nor is there a hook available to display
such an editor in the admin interface directly.

A page should exist that displays a section of the options table for
editing - perhaps even using the metadata in the optiongroups and
optiongroup_options tables (are these b2 remnants or unused new stuff?)
- so that we don't have to write our own interfaces for this.  It could
filter based on an option group so that only the settings that apply to
a single plugin (which would name an option group) would appear in the
table at one time.

Then, plugin authors could include a static link in their plugin
description that points to the settings page with the filter in the
querystring (wp-settings.php?filter=myplugin).

Owen





More information about the hackers mailing list