touch_time( int|bool $edit = 1, int|bool $for_post = 1, int $tab_index = 0, int|bool $multi = 0 )
- Since
- 0.71, 4.4.0
- Source
wp-admin/includes/template.php:809
Compatibility
- WordPress
- since 4.4.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$editint|booloptional- Accepts 1|true for editing the date, 0|false for adding the date.Default:
1 $for_postint|booloptional- Accepts 1|true for applying the date to a post, 0|false for a comment.Default:
1 $tab_indexintoptional- The tabindex attribute to add. Default 0.Default:
0 $multiint|booloptional- Whether the additional fields and buttons should be added.
Default 0|false.Default:0
Performance profile
How much work a call to touch_time() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Scales with input
- Instructions
- 159–208
- Plugin surface
- None
- Called by
- 2
Reaches the database via get_post().
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 317.
Nothing here hands control to plugin code.
2 places in core call this, so the cost is paid more often than your own code shows.
What it touches
- querycontent query
get_post()called directly - hookthird-party callbacks
apply_filters()one call below touch_time() - optionoption read or write
get_option()one call below touch_time()
Further down the call graph this can also reach cache, serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 72 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost touch_time() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!$i | 159–164 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 162–167 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 162–167 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 162–167 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 162–167 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 162–167 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 162–167 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
60 further outcomes, up to 208 instructions
!$i | 165–170 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 165–170 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–173 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 168–171 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 171–176 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 171–176 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 171–176 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 171–176 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 171–176 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 174–179 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf() |
!$i | 187–193 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 190–196 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 190–196 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 190–196 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 190–196 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 190–196 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 190–196 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 193–199 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–202 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 196–200 | get_post(), get_comment(), mysql2date(), current_time(), current_time(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 199–205 | get_post(), get_comment(), current_time(), current_time(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 199–205 | get_post(), get_comment(), current_time(), mysql2date(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 199–205 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), current_time(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 199–205 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), current_time(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 199–205 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
!$i | 202–208 | get_post(), get_comment(), current_time(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), mysql2date(), current_time(), current_time(), current_time(), current_time(), current_time(), __(), __(), __(), __(), __(), __(), printf(), _e(), _e() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 305 | 153–202 | 20 | 12 fewer instructions than PHP 8.5 |
| 8.5 | 317 | 159–208 | 20 | |
| 8.4 | 317 | 159–208 | 20 | |
| 8.3 | 317 | 159–208 | 20 | |
| 8.2 | 317 | 159–208 | 20 | |
| 8.1 | 317 | 159–208 | 20 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 318 | 160–209 | 20 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 8
- get_post()Retrieves post data given a post ID or post object.
- get_comment()Retrieves comment data given a comment ID or comment object.
- mysql2date()Converts given MySQL date string into a different format.
- current_time()Retrieves the current time based on specified type.
- __()Retrieves the translation of $text.
- zeroise()Add leading zeros when necessary.
- selected()Outputs the HTML selected attribute.
- _e()Displays translated text.
Used by · 2
- WP_Posts_List_Table::inline_edit()Outputs the hidden row displayed when inline editing
- post_submit_meta_box()Displays post submit form fields.
Source code
function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { global $wp_locale; $post = get_post(); if ( $for_post ) { $edit = ! ( in_array( $post->post_status, array( 'draft', 'pending' ), true ) && ( ! $post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt ) ); } $tab_index_attribute = ''; if ( (int) $tab_index > 0 ) { $tab_index_attribute = " tabindex=\"$tab_index\""; } $post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date; $jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' ); $mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' ); $aa = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : current_time( 'Y' ); $hh = ( $edit ) ? mysql2date( 'H', $post_date, false ) : current_time( 'H' ); $mn = ( $edit ) ? mysql2date( 'i', $post_date, false ) : current_time( 'i' ); $ss = ( $edit ) ? mysql2date( 's', $post_date, false ) : current_time( 's' ); $cur_jj = current_time( 'd' ); $cur_mm = current_time( 'm' ); $cur_aa = current_time( 'Y' ); $cur_hh = current_time( 'H' ); $cur_mn = current_time( 'i' ); $month = '<label><span class="screen-reader-text">' . /* translators: Hidden accessibility text. */ __( 'Month' ) . '</span><select class="form-required" ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n"; for ( $i = 1; $i < 13; $i = $i + 1 ) { $monthnum = zeroise( $i, 2 ); $monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ); $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected( $monthnum, $mm, false ) . '>'; /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */ $month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $monthtext ) . "</option>\n"; } $month .= '</select></label>'; $day = '<label><span class="screen-reader-text">' . /* translators: Hidden accessibility text. */ __( 'Day' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>'; $year = '<label><span class="screen-reader-text">' . /* translators: Hidden accessibility text. */ __( 'Year' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>'; $hour = '<label><span class="screen-reader-text">' . /* translators: Hidden accessibility text. */ __( 'Hour' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>'; $minute = '<label><span class="screen-reader-text">' . /* translators: Hidden accessibility text. */ __( 'Minute' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>'; echo '<div class="timestamp-wrap">'; /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */ printf( __( '%1$s %2$s, %3$s at %4$s:%5$s' ), $month, $day, $year, $hour, $minute ); echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />'; if ( $multi ) { return; } echo "\n\n"; $map = array( 'mm' => array( $mm, $cur_mm ), 'jj' => array( $jj, $cur_jj ), 'aa' => array( $aa, $cur_aa ), 'hh' => array( $hh, $cur_hh ), 'mn' => array( $mn, $cur_mn ), ); foreach ( $map as $timeunit => $value ) { list( $unit, $curr ) = $value;Changelog
Introduced in 0.71. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$comment.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-admin/includes/template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.