[wp-trac] [WordPress Trac] #18179: WP_Meta_Box

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 27 18:37:54 UTC 2012


#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  |
---------------------------------+-----------------------------

Comment (by ericlewis):

 In 18179.php, I've added a register_meta() method to WP_Meta_Box, which
 can be called for any meta field associated with the meta box, and will
 store it in an instance array variable. I've created an optional array of
 arguments, one of them which is "default_display," which defaults to true.
 This will output a standard form field for the meta entry, and can be
 easily overridden by setting this option to false, and implementing your
 own form field rendering. I devved out just a basic text field for now, as
 I'm not sure how we want to build custom HTML elements and how much
 control should be in the API. I was thinking an array parameter 'attrs'
 which would build the attributes for the form field element.

 Replying to [comment:16 WraithKenny]:
 > On the revision check of `WP_CPT_Meta_Box`: Sometimes authors intend
 revisions to receive metadata updates and restore metadata on post
 restore. It'd be nice to have a built in functionality for this in the API
 (or at least account for it).

 Also, I think the class WP_Meta_Box should have a basic save() method,
 which would check autosave and privileges, which could easily be
 overridden by a subclass as WraithKenny describes.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18179#comment:65>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list