[wp-trac] [WordPress Trac] #17298: Adding optional "fieldname_base" parameter to touch_time() function would allow plugin authors to reuse this code

WordPress Trac wp-trac at lists.automattic.com
Sun May 1 20:50:43 UTC 2011


#17298: Adding optional "fieldname_base" parameter to touch_time() function would
allow plugin authors to reuse this code
-----------------------------+-----------------------------
 Reporter:  goldenapples     |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:
 Severity:  trivial          |   Keywords:
-----------------------------+-----------------------------
 I didn't see any discussion of this over the years, and wondered if this
 was a feature that other people would like to see added:

 In a couple projects, I've had to recreate a date entry form very similar
 to the one generated by the `touch_time()` function in wp-
 admin/includes/template.php. This function could be modified very easily
 to be reusable in plugins.

 The simplest way of doing this, in my opinion, is to accept an optional
 fifth parameter for a fieldname base string.

 Current output of the function:

 {{{

 <select id="mm" name="mm" tabindex="4">
 // options
 </select>
 // etc
 }}}

 If this could be modified by a plugin to output something like this:

 {{{

 <select id="eventstartdate_mm" name="eventstartdate[mm]" tabindex="4">
 // options
 </select>
 // etc
 }}}

 ...it would be very useful. Would improve standardization of UI elements
 between core and plugins.

 Of course, the entire template.php file is A Big Mess. Not sure if we
 should be messing around in there too much.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17298>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list