Make WordPress Core

Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

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


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
// etc

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

<select id="eventstartdate_mm" name="eventstartdate[mm]" tabindex="4">
// options
// 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.

Attachments (1)

17298-patch.patch (206.2 KB) - added by ericjuden 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @scribu
9 years ago

touch_time() is not the ideal date input method. See #7665 and #11942

#2 @ericjuden
9 years ago

I would love to see this in there too! It would be easy enough to add another optional parameter and it would open this up to developers.

#3 @ericjuden
9 years ago

  • Cc ericjuden@… added

9 years ago


#4 @c3mdigital
7 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

See ui-datepicker discussionon #7665

#5 @SergeyBiryukov
7 years ago

  • Component changed from General to Administration
  • Milestone Awaiting Review deleted
  • Severity changed from trivial to normal
  • Type changed from feature request to enhancement
Note: See TracTickets for help on using tickets.