diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css
index b888f610bb..1f3ee0fd31 100644
|
|
body.trashing #publish-settings { |
332 | 332 | margin-top: 10px; |
333 | 333 | } |
334 | 334 | |
335 | | .customize-control.customize-control-date_time .date-time-fields .date-input, |
336 | | .customize-control.customize-control-date_time .date-time-fields .date-time-separator { |
337 | | float: left; |
338 | | margin-right: 5px; |
339 | | } |
340 | 335 | .customize-control.customize-control-date_time .date-time-fields .date-input.day { |
341 | 336 | margin-right: 0; |
342 | 337 | } |
… |
… |
body.trashing #publish-settings { |
370 | 365 | } |
371 | 366 | |
372 | 367 | .date-time-fields .date-timezone { |
373 | | float: left; |
374 | 368 | line-height: 2.2; |
375 | 369 | text-decoration: none; |
376 | 370 | } |
diff --git src/wp-includes/customize/class-wp-customize-date-time-control.php src/wp-includes/customize/class-wp-customize-date-time-control.php
index d1e8d12500..b13e49612f 100644
|
|
class WP_Customize_Date_Time_Control extends WP_Customize_Control { |
98 | 98 | public function content_template() { |
99 | 99 | $data = array_merge( $this->json(), $this->get_month_choices() ); |
100 | 100 | $timezone_info = $this->get_timezone_info(); |
| 101 | |
| 102 | /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */ |
| 103 | $format = sprintf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), '__MONTH__', '__DAY__', '__YEAR__', '__HOUR__', '__MINUTE__' ); |
101 | 104 | ?> |
102 | 105 | |
103 | 106 | <# _.defaults( data, <?php echo wp_json_encode( $data ); ?> ); #> |
… |
… |
class WP_Customize_Date_Time_Control extends WP_Customize_Control { |
116 | 119 | <fieldset class="day-row"> |
117 | 120 | <legend class="title-day {{ ! data.includeTime ? 'screen-reader-text' : '' }}"><?php esc_html_e( 'Date' ); ?></legend> |
118 | 121 | <div class="day-fields clear"> |
| 122 | <?php $fields = array(); ?> |
| 123 | <?php ob_start(); ?> |
119 | 124 | <label for="{{ idPrefix }}date-time-month" class="screen-reader-text"><?php esc_html_e( 'Month' ); ?></label> |
120 | 125 | <select id="{{ idPrefix }}date-time-month" class="date-input month" data-component="month"> |
121 | 126 | <# _.each( data.month_choices, function( choice ) { |
… |
… |
class WP_Customize_Date_Time_Control extends WP_Customize_Control { |
129 | 134 | </option> |
130 | 135 | <# } ); #> |
131 | 136 | </select> |
| 137 | <?php $fields['__MONTH__'] = ob_get_clean(); ?> |
| 138 | |
| 139 | <?php ob_start(); ?> |
132 | 140 | <label for="{{ idPrefix }}date-time-day" class="screen-reader-text"><?php esc_html_e( 'Day' ); ?></label> |
133 | 141 | <input id="{{ idPrefix }}date-time-day" type="number" size="2" autocomplete="off" class="date-input day" data-component="day" min="1" max="31" /> |
134 | | <span class="time-special-char date-time-separator">,</span> |
| 142 | <?php $fields['__DAY__'] = ob_get_clean(); ?> |
| 143 | |
| 144 | <?php ob_start(); ?> |
135 | 145 | <label for="{{ idPrefix }}date-time-year" class="screen-reader-text"><?php esc_html_e( 'Year' ); ?></label> |
136 | 146 | <input id="{{ idPrefix }}date-time-year" type="number" size="4" autocomplete="off" class="date-input year" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}"> |
| 147 | <?php $fields['__YEAR__'] = ob_get_clean(); ?> |
| 148 | |
| 149 | <?php |
| 150 | $tokens = preg_split( '/(__\w+__)/', $format, -1, PREG_SPLIT_DELIM_CAPTURE ); |
| 151 | foreach ( $tokens as $token ) { |
| 152 | if ( '__HOUR__' === $token ) { |
| 153 | break; |
| 154 | } |
| 155 | if ( isset( $fields[ $token ] ) ) { |
| 156 | echo $fields[ $token ]; |
| 157 | } else { |
| 158 | echo "<span class='time-special-char date-time-separator'>$token</span>"; // @todo What if this is token right before __HOUR__: is associated with year or hour? |
| 159 | } |
| 160 | } |
| 161 | ?> |
137 | 162 | </div> |
138 | 163 | </fieldset> |
139 | 164 | <# if ( data.includeTime ) { #> |