WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#10694 closed enhancement (invalid)

Simplify creation of options pages for plugins with custom menus

Reported by: sirzooro Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: Administration Keywords: close reporter-feedback
Focuses: Cc:

Description

wp-admin/options.php file does a good job for handling options pages for plugins, which adds new item(s) to the Settings menu. Unfortunately this simple approach does not work when plugin registers its own menu and puts all options pages in it - in this case these pages goes through wp-admin/admin.php file, which does not handle options saving. It will be good to either handle this in admin.php too, or add a new function which will do this.

Change History (2)

comment:1 dd325 years ago

  • Keywords close reporter-feedback added; needs-patch removed

wp-admin/options.php file does a good job for handling options pages for plugins, which adds new item(s) to the Settings menu. Unfortunately this simple approach does not work when plugin registers its own menu and puts all options pages in it

Yes, It does.

You simply need to direct the form action tag to options.php, Add a field for the page to redirect back to(optional), and add a field listing the options you wish to save (Along with a nonce i think).

See http://codex.wordpress.org/Creating_Options_Pages for the full rundown. Dont forget the register_setting() functionality along with the rest..

Pretty sure this is invalid, but leaving open pending reporter-feedback that this doesnt achieve their goals.

comment:2 sirzooro5 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thanks. I have checked my code and found that I messed parameter passed to the settings_fields() function. So I close this ticket as invalid.

Note: See TracTickets for help on using tickets.