[wp-trac] [WordPress Trac] #18179: WP_Meta_Box
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 23 19:37:20 UTC 2011
#18179: WP_Meta_Box
---------------------------------+-----------------------------
Reporter: koopersmith | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch 3.4-early |
---------------------------------+-----------------------------
Changes (by nacin):
* keywords: has-patch => has-patch 3.4-early
* type: task (blessed) => feature request
* milestone: 3.3 => Future Release
Comment:
> What exactly are you guys thinking in terms of what the class should
actually do and handle?
This is what I was thinking.
Since we now have register_meta(), which includes both sanitization and
authorization callbacks, it would be nifty if a method of WP_Meta_Box
could wrap register_meta() and then register those pieces of meta against
the meta box. We could even enforce sanitization callbacks. Then, there's
no need to have anything that hooks into save_post -- whatever gets sent
back will automatically be saved.
We'd also want form rendering, but that doesn't need to be too complex.
Basic form fields are fine. Likewise, registering a field could
potentially mean that A) basic fields are handled and B) so is the
corresponding sanitization depending on the field and desired data type.
If all goes well though, there's no need to hook into
add_meta_boxes(_$post_type), call add_meta_box(), write your own function
to render things, then hook into save_post too. As much as I've gotten
used to those steps, it can be tedious and has basically no abstraction.
Not a whole lot of iteration went into this ticket, especially since
koopersmith has been on UI stuff for most of the cycle. We're going to
need to punt this to 3.4, but I would love it if work started and
continued uninterrupted during beta and RC, then the moment we branch, we
can commit something awesome.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18179#comment:39>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list