#17298 closed enhancement (wontfix)
Adding optional "fieldname_base" parameter to touch_time() function would allow plugin authors to reuse this code
Reported by: | goldenapples | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
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.
touch_time() is not the ideal date input method. See #7665 and #11942