[wp-trac] [WordPress Trac] #18285: New Settings API and workflow
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 31 20:28:33 UTC 2011
#18285: New Settings API and workflow
----------------------------+------------------
Reporter: nacin | Owner:
Type: task (blessed) | Status: new
Priority: normal | Milestone: 3.3
Component: Plugins | Version:
Severity: normal | Resolution:
Keywords: |
----------------------------+------------------
Changes (by rzen):
* cc: rzen (added)
Comment:
Hey Guys, I'm really excited about the direction this is taking! I hear
nacin saying he doesn't want to handle field generation, but I think
standardizing that (while still allowing for custom callback registration)
is a very smart way to go.
I'm lazy, so last year I built an [http://docs.wpstartbox.com/Options_API
Options API for StartBox] that leverages the Settings API and handles
option registration, sanitization, builds the form element, and saves the
option. In it's current form, like scribu's class, it can register
[http://docs.wpstartbox.com/Options_API:Creating_Options a whole slew of
field types] and uses the admin.css.
Currently, all options in the page get stored to a single serialized
array, and there are helper functions to interact with that data as though
it were a stand-alone option in the options table. There are functions for
[http://docs.wpstartbox.com/Functions:sb_register_settings adding/removing
an entire metabox of options] and
[http://docs.wpstartbox.com/Functions:sb_register_option adding/removing
individual options] as well. It even allows you to register the metabox to
other pages (but they'll only work on my admin page currently).
I don't think it's a perfect solution for this ''yet'', but I think it
would serve as a great launching point. I'd love to help however I can to
roll this idea into core (even if this code is irrelevant). Ptah's
WPFramework does some similar things, maybe better, so maybe even a hybrid
of the methods could be a good route.
You can [https://github.com/brichards/StartBox Download StartBox from
Github] -- all the Options API stuff lives in
/includes/functions/admin_settings.php, and gets put to work in
/includes/functions/admin/...
Looking forward to what you guys think.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18285#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list